Documentation
¶
Overview ¶
Package xstrings provides substring search and ECMAScript whitespace trimming for WTF-8 strings, and case mapping for valid UTF-8 strings.
Index ¶
- func EndsWithCasedLetter(s string, poll func()) bool
- func Index(s, sub wtf8.String, poll func()) int
- func IsWhiteSpaceOrLineTerminator(r rune) bool
- func LastIndex(s, sub wtf8.String, poll func()) int
- func StartsWithCasedLetter(s string, poll func()) bool
- func ToLowerCase(s string, start, end int, poll func()) string
- func ToUpperCase(s string) string
- func TrimWhiteSpace(s wtf8.String, start, end bool) wtf8.String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndsWithCasedLetter ¶
EndsWithCasedLetter reports whether s ends in a cased letter after ignoring trailing case-ignorable characters. poll is as for ToLowerCase.
func Index ¶
Index returns the index of the first instance of sub in s, or -1, in time linear in the lengths of s and sub. poll, which may be nil, is called now and then during a long search, and may stop the search by panicking.
func IsWhiteSpaceOrLineTerminator ¶
IsWhiteSpaceOrLineTerminator reports whether r is WhiteSpace or LineTerminator.
func LastIndex ¶
LastIndex returns the index of the last instance of sub in s, or -1, in time linear in the lengths of s and sub. poll is as for Index.
func StartsWithCasedLetter ¶
StartsWithCasedLetter reports whether s starts with a cased letter after ignoring leading case-ignorable characters. poll is as for ToLowerCase.
func ToLowerCase ¶
ToLowerCase maps s[start:end] to full default lowercase in the context of s. s must be valid UTF-8 and both offsets must be rune boundaries. A non-nil poll may interrupt a long mapping.
func ToUpperCase ¶
ToUpperCase returns the full default uppercase mapping of a valid UTF-8 string.
Types ¶
This section is empty.