class
StringUtility
Utility class for manipulating Strings.
Public
Methods
staticTrim
Removes any whitespace characters from beginning or end of the string.
staticTrim
Removes any whitespace characters from beginning or end of the string.
staticTrim
Removes any whitespace characters from beginning or end of the string view.
staticTrim
Removes specified characters from beginning or end of the string.
staticTrim
Removes any whitespace characters from beginning or end of the string.
staticTrim
Removes specified characters from beginning or end of the string view.
staticSplit
Returns a vector of strings containing all the substrings delimited by the provided delimiter characters.
- str
- The string to split.
- delims
- (optional) Delimiter characters to split the string by. They will not be included in resulting substrings.
- maxSplits
- (optional) The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right.
staticSplit
Returns a vector of strings containing all the substrings delimited by the provided delimiter characters.
- str
- The string to split.
- delims
- (optional) Delimiter characters to split the string by. They will not be included in resulting substrings.
- maxSplits
- (optional) The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right.
staticTokenise
Returns a vector of strings containing all the substrings delimited by the provided delimiter characters, or the double delimiters used for including normal delimiter characters in the tokenized string.
- str
- The string to split.
- delims
- (optional) Delimiter characters to split the string by. They will not be included in resulting substrings.
- doubleDelims
- (optional) Delimiter character you may use to surround other normal delimiters, in order to include them in the tokensized string.
- maxSplits
- (optional) The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right.
staticTokenise
Returns a vector of strings containing all the substrings delimited by the provided delimiter characters, or the double delimiters used for including normal delimiter characters in the tokenized string.
- str
- The string to split.
- delims
- (optional) Delimiter characters to split the string by. They will not be included in resulting substrings.
- doubleDelims
- (optional) Delimiter character you may use to surround other normal delimiters, in order to include them in the tokensized string.
- maxSplits
- (optional) The maximum number of splits to perform (0 for unlimited splits). If this parameters is > 0, the splitting process will stop after this many splits, left to right.
staticHexToLiteral
Converts one or multiple 32-bit numbers into a literal hexidecimal representation.
Each entry is separated with a desh.
staticHexToLiteral
Converts one or multiple 64-bit numbers into a literal hexidecimal representation.
Each entry is separated with a desh.
staticToLowerCase
Converts all the characters in the string to lower case.
Does not handle UTF8 encoded strings.
staticToLowerCase
Converts all the characters in the string to lower case.
Does not handle UTF8 encoded strings.
staticToUpperCase
Converts all the characters in the string to upper case.
Does not handle UTF8 encoded strings.
staticToUpperCase
Converts all the characters in the string to upper case.
Does not handle UTF8 encoded strings.
staticStartsWith
Returns whether the string begins with the pattern passed in.
- str
- String to compare.
- pattern
- Pattern to compare with.
- lowerCase
- (optional) If true, the start of the string will be lower cased before comparison, and the pattern should also be in lower case.
staticStartsWith
staticEndsWith
Returns whether the string end with the pattern passed in.
- str
- String to compare.
- pattern
- Pattern to compare with.
- lowerCase
- (optional) If true, the start of the string will be lower cased before comparison, and the pattern should also be in lower case.
staticEndsWith
staticMatch
Returns true if the string matches the provided pattern.
Pattern may use a "*" wildcard for matching any characters.
- str
- The string to test.
- pattern
- Patterns to look for.
- caseSensitive
- (optional) Should the match be case sensitive or not.
staticMatch
staticReplaceAll
Replace all instances of a substring with a another substring.
- source
- String to search.
- replaceWhat
- Substring to find and replace
- replaceWithWhat
- Substring to replace with (the new sub-string)
Returns: An updated string with the substrings replaced.
staticReplaceAll
staticStripExtension
Removes the file extension from the provided string.
If string has multiple extensions, only the last extension will be removed.