Documentation ¶
Overview ¶
Package String provides a generic string functions.
Index ¶
- func ASCII[S Any](s S) string
- func AddPathElement[S Any](s S, file S) S
- func Append[S Any, B Any](a S, b B) S
- func As[T, S Any](s S) T
- func Bigrams[S Any](s S) iter.Seq[S]
- func BinaryToInteger[S Any](s S) int
- func Capitalize[S Any](s S) S
- func Character[I Int.Any](chr I) string
- func Clean[S Any](s S) S
- func Comparison[A, B Any](a A, b B) int
- func ComparisonIgnoreCasing[A, B Any](a A, b B) int
- func ComparisonNatural[S Any](a, b S) int
- func ComparisonNaturalPrioritizePeriodsAndUnderscores[S Any](a, b S) int
- func ComparisonStrictNatural[S Any](a, b S) int
- func ComparisonStrictNaturalPrioritizePeriodsAndUnderscores[S Any](a, b S) int
- func Contains[A, B Any](what A, s B) bool
- func ContainsStrict[S Any](what S, s S) bool
- func Count[D Any, S Any](what D, s S) int
- func CountStrict[S Any](what S, s S) int
- func Decimal[F Float.Any](number F) string
- func DecodeHex[S Any](s S) S
- func DecodeURI[S Any](s S) S
- func Dedent[S Any](s S) S
- func EncodeHex[S Any](s S) S
- func EncodeURI[S Any](s S) S
- func Erase[S Any, I Int.Any](position I, s S) S
- func Escape[S Any](s S) S
- func Extract[S Any, D Any, I Int.Any](s S, delimiter D, index I) S
- func ExtractFloats[S Any, D Any](sep D, s S) []Float.X
- func FileExtension[S Any](path S) S
- func FileName[S Any](path S) S
- func FindIndex[S, V Any](s S, what V) int
- func FindLast[S Any, W Any](s S, what W) int
- func FindLastStrict[S Any](s S, what S) int
- func FindStrict[S Any](what S, s S) int
- func First[S Any, I Int.Any](n I, s S) S
- func Format[S Any](format S, args ...any) S
- func HasPrefix[S, P Any](s S, prefix P) bool
- func HasSuffix[S, B Any](s S, suffix B) bool
- func Hash[S Any](s S) uint32
- func HexToInteger[S Any](s S) int
- func HumanReadableSize(size int) string
- func Indent[S Any](s, prefix S) S
- func Index[S Any](s S, i int) byte
- func Insert[S Any](what, s S, position int) S
- func Integer[I Int.Any](number I) string
- func IsEmpty[S Any](s S) bool
- func IsStrictSubsequenceOf[S Any](text, s S) bool
- func IsSubsequenceOf[S Any](text, s S) bool
- func IsValidFilename[S Any](s S) bool
- func IsValidFloat[S Any](s S) bool
- func IsValidHexColor[S Any](s S) bool
- func IsValidHexNumber[S Any](s S) bool
- func IsValidIdentifier[S Any](s S) bool
- func IsValidInt[S Any](s S) bool
- func IsValidInternetProtocolAddress[S Any](s S) bool
- func JoinedWith[S, D Any](d D, s ...S) S
- func Last[S Any](length int, s S) S
- func Length[S Any](s S) int
- func MD5[S Any](s S) []byte
- func Map[S Any](mapping func(Rune) Rune, s S) S
- func Match[S Any](pattern, text S) bool
- func MatchStrict[S Any](pattern, text S) bool
- func Natural[I ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uint | ~uintptr](number I) string
- func NumExtractions[S Any, D Any](s S, delimiter D) int
- func PadDecimals[S Any](s S, digits int) S
- func PadPrefix[S Any](s S, min_length int) S
- func PadSuffix[S Any](s S, min_length int) S
- func PadZeros[S Any](s S, digits int) S
- func Proxy[S Any, T API](s S, reuse func(T, complex128) bool, alloc func() (T, complex128)) (T, complex128)
- func Repeat[S Any](s S, count int) S
- func Replace[S Any, T Any](s S, old, new T) S
- func ReplaceStrict[S Any](s S, what, forwhat S) S
- func Reverse[S Any](s S) S
- func ReverseSplit[S Any](s S, delimiter S) []S
- func Runes[S Any](s S) iter.Seq2[int, Rune]
- func SHA1[S Any](s S) S
- func SHA256[S Any](s S) S
- func Scientific[F Float.Any](number F) string
- func Similarity[S Any](a, b S) Float.X
- func SimplifyPath[S Any](s S) S
- func Slice[S Any, A, B Int.Any](s S, start A, close B) S
- func Splits[S Any, B Any](s S, sep B) iter.Seq[S]
- func StartingFrom[S Any](s S, start int) S
- func StripEscapes[S Any](s S) S
- func StripFilename[S Any](s S) S
- func StripNodeName[S Any](s S) S
- func StripPrefix[S Any, C ~string | ~[]byte](s S, chars C) S
- func StripSuffix[S Any](s S, chars S) S
- func Title[S Any](s S) S
- func ToASCII[S Any](s S) []byte
- func ToCamelCase[S Any](s S) S
- func ToFloat[S Any](s S) Float.X
- func ToInt[S Any](s S) int
- func ToLower[S Any](s S) S
- func ToPascalCase[S Any](s S) S
- func ToSnakeCase[S Any](s S) S
- func ToUTF16[S Any](s S) []byte
- func ToUTF32[S Any](s S) []byte
- func ToUTF8[S Any](s S) []byte
- func ToUpper[S Any](s S) S
- func TrimPrefix[S, P Any](s S, prefix P) S
- func TrimSuffix[S, P Any](s S, suffix P) S
- func UTF16[S Any](s []byte) string
- func UTF32[S Any](s S) string
- func UTF8[S Any](s []byte) string
- func Unescape[S Any](s S) S
- type API
- type Any
- type Comparable
- type Generic
- type Name
- type Readable
- type Rune
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASCII ¶
ASCII converts ASCII/Latin-1 encoded array to string. Fast alternative to get_string_from_utf8 if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use UTF8. This is the inverse of ToASCII.
func AddPathElement ¶
func AddPathElement[S Any](s S, file S) S
AddPathElement concatenates file at the end of the string as a subpath, adding / if necessary.
func Bigrams ¶
Bigrams returns a sequence of bigrams (pairs of consecutive characters) in this string.
func BinaryToInteger ¶
BinaryToInteger converts the string representing a binary number into an int. The string may optionally be prefixed with "0b", and an additional - prefix for negative numbers.
func Capitalize ¶
func Capitalize[S Any](s S) S
Capitalize changes the appearance of the string: replaces underscores (_) with spaces, adds spaces before uppercase letters in the middle of a word, converts all letters to lowercase, then converts the first one and each one following a space to uppercase.
func Character ¶
Character returns a single Unicode character from the decimal char. You may use unicodelookup.com or unicode.org as points of reference.
func Clean ¶
func Clean[S Any](s S) S
Clean removes all leading and trailing whitespace from the string.
func Comparison ¶
Comparison performs a case-sensitive comparison to another string. Returns -1 if less than, 1 if greater than, or 0 if equal. "Less than" and "greater than" are determined by the Unicode code points of each string, which roughly matches the alphabetical order.
With different string lengths, returns 1 if this string is longer than the to string, or -1 if shorter. Note that the length of empty strings is always 0.
To get a bool result from a string comparison, use the == operator instead. See also Comparison, ComparisonStrictNaturalPrioritizePeriodsAndUnderscores, and ComparisonStrictNatural.
func ComparisonIgnoreCasing ¶
ComparisonIgnoreCasing performs a case-insensitive comparison to another string. Returns -1 if less than, 1 if greater than, or 0 if equal. "Less than" or "greater than" are determined by the Unicode code points of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison.
With different string lengths, returns 1 if this string is longer than the to string, or -1 if shorter. Note that the length of empty strings is always 0.
To get a bool result from a string comparison, use the == operator instead. See also [ComparisonStrict], ComparisonStrictNaturalPrioritizePeriodsAndUnderscores, and ComparisonNatural.
func ComparisonNatural ¶
ComparisonNatural performs a case-insensitive, natural order comparison to another string. Returns -1 if less than, 1 if greater than, or 0 if equal. "Less than" or "greater than" are determined by the Unicode code points of each string, which roughly matches the alphabetical order. Internally, lowercase characters are converted to uppercase for the comparison.
When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be ["1", "2", "3", ...], not ["1", "10", "2", "3", ...].
With different string lengths, returns 1 if this string is longer than the to string, or -1 if shorter. Note that the length of empty strings is always 0.
To get a bool result from a string comparison, use the == operator instead. See also ComparisonStrictNatural, ComparisonStrictNaturalPrioritizePeriodsAndUnderscores, and Comparison.
func ComparisonNaturalPrioritizePeriodsAndUnderscores ¶
ComparisonNaturalPrioritizePeriodsAndUnderscores like naturalnocasecmp_to but prioritizes strings that begin with periods (.) and underscores (_) before any other character. Useful when sorting folders or file names.
To get a bool result from a string comparison, use the == operator instead. See also ComparisonStrictNaturalPrioritizePeriodsAndUnderscores, ComparisonNatural, and Comparison.
func ComparisonStrictNatural ¶
ComparisonStrictNatural performs a case-sensitive, natural order comparison to another string. Returns -1 if less than, 1 if greater than, or 0 if equal. "Less than" or "greater than" are determined by the Unicode code points of each string, which roughly matches the alphabetical order.
When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit's value. A sorted sequence of numbered strings will be ["1", "2", "3", ...], not ["1", "10", "2", "3", ...].
With different string lengths, returns 1 if this string is longer than the to string, or -1 if shorter. Note that the length of empty strings is always 0.
To get a bool result from a string comparison, use the == operator instead. See also ComparisonNatural, ComparisonNaturalPrioritizePeriodsAndUnderscores, and Comparison.
func ComparisonStrictNaturalPrioritizePeriodsAndUnderscores ¶
ComparisonStrictNaturalPrioritizePeriodsAndUnderscores like ComparisonStrictNatural but prioritizes strings that begin with periods (.) and underscores (_) before any other character. Useful when sorting folders or file names.
To get a bool result from a string comparison, use the == operator instead. See also ComparisonNaturalPrioritizePeriodsAndUnderscores, ComparisonStrictNatural, and [ComparisonStrict].
func Contains ¶
Contains returns true if the string contains what, ignoring case. If you need to know where what is within the string, use findn. See also Contains.
func ContainsStrict ¶
ContainsStrict returns true if the string contains case-sensitive what. If you need to know where what is within the string, use [Find]. See also Contains.
func CountStrict ¶
CountStrict returns the number of occurrences of the case-sensitive substring.
func Decimal ¶
Decimal converts a float to a string representation of a decimal number, with the number of decimal places specified in decimals.
The string representation may only have up to 14 significant digits, with digits before the decimal point having priority over digits after.
Trailing zeros are not included in the string. The last digit is rounded, not truncated.
func DecodeURI ¶
func DecodeURI[S Any](s S) S
DecodeURI decodes the string from URL-friendly format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request. See also EncodeURI.
func Dedent ¶
func Dedent[S Any](s S) S
Dedent returns a copy of the string with indentation (leading tabs and spaces) removed. See also Indent to add indentation.
func EncodeURI ¶
func EncodeURI[S Any](s S) S
EncodeURI encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request. See also DecodeURI.
func Escape ¶
func Escape[S Any](s S) S
Escape returns a copy of the string with special characters escaped using the Go language standard.
func Extract ¶
Extract splits the string using a delimiter and returns the substring at index. Returns the original string if delimiter does not occur in the string. Returns an empty string if the element does not exist.
This is faster than split, if you only need one substring.
func ExtractFloats ¶
ExtractFloats splits the string into floats by using a delimiter and returns a [Float.X] slice.
func FileExtension ¶
func FileExtension[S Any](path S) S
FileExtension returns the file extension without the leading period (.) if the string is a valid file name or path. Otherwise, returns an empty string.
func FileName ¶
func FileName[S Any](path S) S
FileName returns the file name, including the extension, if the string is a valid file path,
func FindIndex ¶
FindIndex returns the index of the first occurrence of what in this string, ignoring case. Returns -1 if not found.
func FindLast ¶
FindLast returns the index of the last occurrence of what in this string, or -1 if there are none. This method is the reverse of [Find].
func FindLastStrict ¶
FindLastStrict returns the index of the last occurrence of what in this string, or -1 if there are none. This method is the reverse of FindStrict.
func FindStrict ¶
FindStrict returns the index of the first case-sensitive occurrence of what in this string or -1 if not found.
func First ¶
First, returns the first n characters from the beginning of the string. If length is negative, strips the last length characters from the string's end.
func Format ¶
Format formats the string by replacing all occurrences of placeholder with the elements of values.
Any underscores in placeholder will be replaced with the corresponding keys in advance. Array elements use their index as keys.
Note: The replacement of placeholders is not done all at once, instead each placeholder is replaced in the order they are passed, this means that if one of the replacement strings contains a key it will also be replaced. This can be very powerful, but can also cause unexpected results if you are not careful. If you do not need to perform replacement in the replacement strings, make sure your replacements do not contain placeholders to ensure reliable results.
func HasPrefix ¶
HasPrefix returns true if the string begins with the given text. See also HasSuffix.
func Hash ¶
Hash Returns the 32-bit hash value representing the string's contents.
Note: Strings with equal hash values are not guaranteed to be the same, as a result of hash collisions. On the contrary, strings with different hash values are guaranteed to be different.
func HexToInteger ¶
HexToInteger Converts the string representing a hexadecimal number into an int. The string may be optionally prefixed with "0x", and an additional - prefix for negative numbers.
func HumanReadableSize ¶
HumanReadableSize converts size which represents a number of bytes into a human-readable form.
The result is in IEC prefix format, which may end in either "B", "KiB", "MiB", "GiB", "TiB", "PiB", or "EiB".
func Indent ¶
func Indent[S Any](s, prefix S) S
Indent indents every line of the string with the given prefix. Empty lines are not indented. See also Dedent to remove indentation.
For example, the string can be indented with two tabulations using "\t\t", or four spaces using " ".
func Index ¶
Index returns the byte at the given index in the string. If the index is out of range, this function will panic. See also Slice.
func IsStrictSubsequenceOf ¶
IsStrictSubsequenceOf returns true if all characters of this string can be found in text in their original order.
func IsSubsequenceOf ¶
IsSubsequenceOf returns true if all characters of this string can be found in text in any order, ignoring case.
func IsValidFilename ¶
IsValidFilename returns true if this string does not contain characters that are not allowed in file names (: / \ ? * " | % < >).
func IsValidFloat ¶
IsValidFloat returns true if this string represents a valid floating-point number. A valid float may contain only digits, one decimal point (.), and the exponent letter (e). It may also be prefixed with a positive (+) or negative (-) sign. Any valid integer is also a valid float (see IsValidInt). See also ToFloat.
func IsValidHexColor ¶
IsValidHexColor Returns true if this string is a valid color in hexadecimal HTML notation. The string must be a hexadecimal value (see is_valid_hex_number) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign (#). Other HTML notations for colors, such as names or hsl(), are not considered valid.
func IsValidHexNumber ¶
IsValidHexNumber returns true if this string is a valid hexadecimal number. A valid hexadecimal number only contains digits or letters A to F (either uppercase or lowercase), and may be prefixed with a positive (+) or negative (-) sign.
func IsValidIdentifier ¶
IsValidIdentifier returns true if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (_), and the first character may not be a digit.
func IsValidInt ¶
IsValidInt returns true if this string represents a valid integer. A valid integer only contains digits, and may be prefixed with a positive (+) or negative (-) sign. See also ToInt.
func IsValidInternetProtocolAddress ¶
IsValidInternetProtocolAddress returns true if this string represents a well-formatted IPv4 or IPv6 address. This method considers reserved IP addresses such as "0.0.0.0" and "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" as valid.
func JoinedWith ¶
func JoinedWith[S, D Any](d D, s ...S) S
JoinedWith returns the concatenation of parts' elements, with each element separated by the string calling this method. This method is the opposite of Splits.
func Last ¶
Last returns the last length characters from the end of the string. If length is negative, returns the first length characters from the string's beginning.
func Map ¶
Map returns a copy of the string s with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the string with no replacement.
func Match ¶
Match does a simple case-insensitive expression match, where * matches zero or more arbitrary characters and ? matches any single character except a period (.). An empty string or empty expression always evaluates to false.Does a simple case-insensitive expression match, where * matches zero or more arbitrary characters and ? matches any single character except a period (.). An empty string or empty expression always evaluates to false.
func MatchStrict ¶
MatchStrict does a simple expression match (also called "glob" or "globbing"), where * matches zero or more arbitrary characters and ? matches any single character except a period (.). An empty string or empty expression always evaluates to false.
func Natural ¶
Natural converts the given unsigned int to a string representation, with the given base.
func NumExtractions ¶
NumExtractions returns the total number of extractable substrings when the string is split with the given delimiter (see Splits).
func PadDecimals ¶
PadDecimals formats the string representing a number to have an exact number of digits after the decimal point.
func PadPrefix ¶
PadPrefix formats the string to be at least min_length long by adding characters to the left of the string, if necessary. See also PadSuffix.
func PadSuffix ¶
PadSuffix formats the string to be at least min_length long, by adding characters to the right of the string, if necessary. See also PadPrefix.
func PadZeros ¶
PadZeros formats the string representing a number to have an exact number of digits before the decimal point.
func Proxy ¶
func Proxy[S Any, T API](s S, reuse func(T, complex128) bool, alloc func() (T, complex128)) (T, complex128)
Proxy can be used to transform the underlying encoding and implementation of a Readable string into a specific type. The alloc function should return a new [Implementation] of the desired type, and the internal state. This may be cached in the existing implementation and, if so, will be passed to the check function so that it can decide whether to reuse the cache or not.
The uint64 can be used to avoid unnecessary allocations, such that T can be zero-sized if the implementation does not require more that 64bits of state.
func Repeat ¶
Repeat repeats this string a number of times. count needs to be greater than 0. Otherwise, returns an empty string.
func Replace ¶
Replace replaces all case-insensitive occurrences of what inside the string with the given forwhat.
func ReplaceStrict ¶
func ReplaceStrict[S Any](s S, what, forwhat S) S
ReplaceStrict replaces all occurrences of what inside the string with the given forwhat.
func Reverse ¶
func Reverse[S Any](s S) S
Reverse returns the copy of this string in reverse order. This operation works on unicode codepoints, rather than sequences of codepoints, and may break things like compound letters or emojis.
func ReverseSplit ¶
func ReverseSplit[S Any](s S, delimiter S) []S
ReverseSplit splits the string using a delimiter and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string.
func Scientific ¶
Scientific converts the given number to a string representation, in scientific notation.
func Similarity ¶
Similarity returns the similarity index (Sorensen-Dice coefficient) of this string compared to another. A result of 1.0 means totally similar, while 0.0 means totally dissimilar.
func SimplifyPath ¶
func SimplifyPath[S Any](s S) S
SimplifyPath converts the string into a canonical path if the string is a valid file path. This is the shortest possible path, without "./", and all the unnecessary ".." and "/".
func Splits ¶
Splits returns a sequence of substrings by splitting the string using a delimiter. If the delimiter is an empty string, each substring will be a single character. This method is the opposite of JoinedWith.
func StartingFrom ¶
StartingFrom returns a slice of the string from the given start index to the end index.
func StripEscapes ¶
func StripEscapes[S Any](s S) S
StripEscapes strips all escape characters from the string. These include all non-printable control characters of the first page of the ASCII table (values from 0 to 31), such as tabulation (\t) and newline (\n, \r) characters, but not spaces.
func StripFilename ¶
func StripFilename[S Any](s S) S
StripFilename returns a copy of the string with all characters that are not allowed in IsValidFilename replaced with underscores.
func StripNodeName ¶
func StripNodeName[S Any](s S) S
StripNodeName returns a copy of the string with all characters that are not allowed in Node.name (. : @ / " %) replaced with underscores.
func StripPrefix ¶
StripPrefix removes a set of characters defined in chars from the string's beginning. See also StripSuffix.
Note: chars is a cutset. Use TrimPrefix to remove a whole prefix string, rather than a set of characters.
func StripSuffix ¶
func StripSuffix[S Any](s S, chars S) S
StripSuffix removes a set of characters defined in chars from the string's end. See also StripPrefix.
Note: chars is a cutset. Use TrimSuffix to remove an entire suffix, rather than a set of characters.
func Title ¶
func Title[S Any](s S) S
Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case. Is not always reliable in the presence of punctuation.
func ToASCII ¶
ToASCII converts the string to an ASCII/Latin-1 encoded byte slice. This method is slightly faster than ToUTF8, but replaces all unsupported characters with spaces.
func ToCamelCase ¶
func ToCamelCase[S Any](s S) S
ToCamelCase returns the string converted to camelCase.
func ToFloat ¶
ToFloat converts the string representing a decimal number into a float. This method stops on the first non-number character, except the first decimal point (.) and the exponent letter (e). See also IsValidFloat.
func ToInt ¶
ToInt converts the string representing an integer number into an int. This method removes any non-number character and stops at the first decimal point (.). See also IsValidInt.
func ToPascalCase ¶
func ToPascalCase[S Any](s S) S
ToPascalCase returns the string converted to PascalCase.
func ToSnakeCase ¶
func ToSnakeCase[S Any](s S) S
ToSnakeCase Returns the string converted to snake_case.
Note: Numbers followed by a single letter are not separated in the conversion to keep some words (such as "2D") together.
func ToUTF8 ¶
ToUTF8 converts the string to a UTF-8 encoded byte slice. This method is slightly slower than ToASCII, but supports all UTF-8 characters. For most cases, prefer using this method.
func TrimPrefix ¶
func TrimPrefix[S, P Any](s S, prefix P) S
TrimPrefix removes the given prefix from the start of the string, or returns the string unchanged.
func TrimSuffix ¶
func TrimSuffix[S, P Any](s S, suffix P) S
TrimSuffix removes the given suffix from the end of the string, or returns the string unchanged.
func UTF16 ¶
UTF16 converts UTF-16 encoded array to String. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string. This is the inverse of ToUTF16.
func UTF32 ¶
UTF32 converts UTF-32 encoded array to string. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-32 string. This is the inverse of ToUTF32.
func UTF8 ¶
UTF8 converts UTF-8 encoded array to string. Slower than ASCII but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. This is the inverse of ToUTF8.
Types ¶
type API ¶
type API interface { Len(complex128) int Slice(complex128, int, int) Readable String(complex128) string Index(complex128, int) byte DecodeRune(complex128) (Rune, int, Readable) AppendRune(complex128, Rune) Readable AppendOther(complex128, API, complex128) Readable AppendString(complex128, string) Readable }
API required to implement a Readable string.
type Comparable ¶
type Comparable = struct {
// contains filtered or unexported fields
}
Comparable string optimized for use as a key, such that comparisons are efficient.
func MakeComparable ¶
func MakeComparable[T Any](s T) Comparable
type Generic ¶
type Generic = struct {
// contains filtered or unexported fields
}
Generic can be used as a ~T parameter that accept any Readable-like type.
type Readable ¶
type Readable Generic
Readable string containing human-readable characters in an implementation-specific encoding.
func Via ¶
func Via(impl API, state complex128) Readable
func (Readable) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Readable) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.