Provides some string utilities methods.
static public function replace(source:String, search:String, replaceWith:String):String
Replaces all occurencies of the passed-in string search with the
passed-in string replaceWith in the passed-in string source.
source | string source |
search | string to replace |
replaceWith | string to insert |
static public function replaceAt(source:String, index:Number, replaceWith:String):String
Replaced character defined at index position in source string with passed-in
replaceWith substring.
source | String to parse |
index | Position |
replaceWith | String to insert |
static public function insertAt(source:String, index:Number, insert:String):String
Inserts passed-in insert string at index position in source
string.
source | String to parse |
index | Position |
insert | String to insert in source string |
static public function remove(source:String, toRemove:String):String
Removes passed-in remvove substring from source string.
source | String to parse |
static public function removeAt(source:String, index:Number):String
Removes character at passed-in index position.
source | String to parse |
index | Position |
static public function reverse(source:String):String
Reverses the passed-in source string.
source | source string |
static public function trim(source:String, chars:String):String
Removes all empty characters, defined in EMPTY_CHARS property,
at the beginning and end of the passed-in source
string.
source | Source string |
chars | (optional) Character list to trim. ( default use EMPTY_CHARS ) |
static public function leftTrim(source:String, chars:String):String
Removes all empty characters, defined in EMPTY_CHARS property,
at the beginning of the passed-in source string.
source | Source string |
chars | (optional) Character list to trim. ( default use EMPTY_CHARS ) |
static public function rightTrim(source:String, chars:String):String
Removes all empty characters, defined in EMPTY_CHARS property,
at the end of the passed-in source string.
source | Source string |
chars | (optional) Character list to trim. ( default use EMPTY_CHARS ) |
static public function isStartingWith(source:String, search:String):Boolean
Returns true if passed-in source starts with passed-in
search string.
source | string to evaluate |
search | search string |
static public function isEndingWith(source:String, search:String):Boolean
Returns true if passed-in source ends with passed-in
search string.
source | string to evaluate |
search | search string |
static public function contains(source:String, search:String):Boolean
Returns true if passed-in search string is contained on
passed-in source one.
static public function areEqual(source1:String, source2:String, caseSensitive:Boolean):Boolean
Returns true is 2 passed string are equals.
Use passed-in caseSensitive argument to use case sensitive test.
source1 | First string |
source2 | Second string to compare |
caseSensitive | (optional) true to enable case sensitive
test, otherwise false
|
static public function isWhiteSpace(char:String):BooleanReturns true if the specified string is a single space, tab, return, or newline character.
char | String to test
|
static public function substitute(source:String):StringSubstitutes "{n}" tokens within the specified string with their respective arguments passed in.
source | String to parse
|
... | arguments to use for substitution. |
static public function substituteByArray(source:String, array:Array):String
Substitutes "{n}" tokens within the specified string with passed-in
args array content.
source | String to parse
|
array | Content to use for substitution. |
static public function uppercaseFirst(source:String):String
Capitalizes the first letter of passed-in source string.
static public function uppercaseWords(source:String):String
Capitalizes the first character of every word in the passed-in source.