String (struct)¶
Methods¶
String ( in String other ) | |
String () | |
String | capitalize ? () |
String | clone ? () |
String | concat ? ( in String other ) |
Size | count ? ( in String search ) |
Size | count ? ( in String search, in Size start, in Size end ) |
Boolean | endsWith ? ( in String search ) |
Boolean | endsWith ? ( in String search, in Size start, in Size end ) |
String | fill ! ( in String c, in Size count ) |
Integer | find ? ( in String search ) |
Integer | find ? ( in String search, in Size start ) |
Boolean | isAlpha ? () |
Boolean | isAlphaNumeric ? () |
Boolean | isDigit ? () |
String | join ? ( in String segments[] ) |
String | left ? ( in Size divider ) |
String | leftStrip ? ( in Size length ) |
String | lower ? () |
String[] | partition ? ( in String separator ) |
String | replace ? ( in String search, in String replacement ) |
String | replace ? ( in String search, in String replacement, in Size count ) |
String | replaceAny ? ( in String search, in String replacement ) |
String | replaceAny ? ( in String search, in String replacement, in Size count ) |
String | reverse ? () |
Integer | reverseFind ? ( in String search ) |
Integer | reverseFind ? ( in String search, in Size end ) |
String[] | reversePartition ? ( in String separator ) |
String | right ? ( in Size length ) |
String | rightStrip ? ( in Size length ) |
String[] | split ? ( in String separator ) |
String[] | splitAny ? ( in String separator ) |
Boolean | startsWith ? ( in String search ) |
Boolean | startsWith ? ( in String search, in Size start, in Size end ) |
String | subString ? ( in Size start, in Size length ) |
Integer | toInteger ? () |
Scalar | toScalar ? () |
String | upper ? () |
String | whiteSpace ! ( in Size count ) |
Methods in detail¶
copy constructor
String ()
default constructor
returns copy of the string with its first character capitalized and the rest as lower case.
clone method
String String.concat? ( in String other )
returns this + other
Size String.count? ( in String search )
returns the number of non-overlapping occurrences of substring search
Size String.count? ( in String search, in Size start, in Size end )
returns the number of non-overlapping occurrences of substring search in the range [start, end]
Boolean String.endsWith? ( in String search )
returns true if the string ends with the specified suffix, otherwise return false
Boolean String.endsWith? ( in String search, in Size start, in Size end )
returns true if the string ends with the specified suffix, otherwise return false beginning at the start position, ending at the end position
String String.fill! ( in String c, in Size count )
returns a string containing the provided string several times
Integer String.find? ( in String search )
returns the first position of a search string returns -1 if it’s not found
Integer String.find? ( in String search, in Size start )
returns the first position of a search string given a start index returns -1 if it’s not found
Boolean String.isAlpha? ()
returns true if all characters in the string are alphabetic and there is at least one character, false otherwise.
Boolean String.isAlphaNumeric? ()
returns true if all characters in the string are alphanumeric and there is at least one character, false otherwise.
Boolean String.isDigit? ()
returns true if all characters in the string are digits and there is at least one character, false otherwise.
String String.join? ( in String segments[] )
returns the joined string array using this as a separator
String String.left? ( in Size divider )
returns a substring on the left
String String.leftStrip? ( in Size length )
returns a string truncated by a number of chars on the left For example, “Fabric”.leftStrip(2) is “bric”
returns a version of this string with all chars lowercase
String[] String.partition? ( in String separator )
split the string once by the first occurrence of the separator string, returns three segments (left, separator, right)
String String.replace? ( in String search, in String replacement )
replace any occurrence of a search string with a replacement string
String String.replace? ( in String search, in String replacement, in Size count )
replace a given number of occurrences of a search string with a replacement string
String String.replaceAny? ( in String search, in String replacement )
replace any occurrences of any character in a search string with a replacement string
String String.replaceAny? ( in String search, in String replacement, in Size count )
replace a given number of occurrences of any character in a search string with a replacement string
returns a reversed version of this string
Integer String.reverseFind? ( in String search )
returns the last position of a search string returns -1 if it’s not found
Integer String.reverseFind? ( in String search, in Size end )
returns the last position of a search string given a last index returns -1 if it’s not found
String[] String.reversePartition? ( in String separator )
split the string once by the last occurrence of the separator string, returns three segments (left, separator, right)
String String.right? ( in Size length )
returns a substring on the right For example, “Fabric”.right(2) is “ic”
String String.rightStrip? ( in Size length )
returns a string truncated by a number of chars on the right
String[] String.split? ( in String separator )
splitting this string by a given separator
String[] String.splitAny? ( in String separator )
splitting by all characters contained in the separator string
Boolean String.startsWith? ( in String search )
returns true if the string starts with the specified suffix, otherwise return false
Boolean String.startsWith? ( in String search, in Size start, in Size end )
returns true if the string starts with the specified suffix, otherwise return false beginning at the start position, ending at the end position
String String.subString? ( in Size start, in Size length )
returns a substring given a start index and a length
Integer String.toInteger? ()
returns the content of this string as an Integer
returns the content of this string as a Scalar
returns a version of this string with all chars uppercase
String String.whiteSpace! ( in Size count )
returns a string filled with a specific number of spaces