Contains utility methods for working with strings.
public static function addAt(string:String, value:int, position:*):String
Adds/inserts a new string at a certain position in the source string.
Parameters
| string:String |
| |
| value:int |
| |
| position:* |
Returns
public static function fixNewlines(string:String):String
Fixes double newlines in a text.
Parameters
Returns
public static function hasText(string:String):Boolean
Checks if the given string has actual text.
Parameters
Returns
public static function isDigit(a:String):Boolean
Returns if the given character is a digit or not.
Parameters
Returns
public static function isWhitespace(a:String):Boolean
Returns if the given character is a white space or not.
Parameters
Returns
public static function leftTrim(string:String):String
Removes all empty characters at the beginning of a string.
Characters that are removed: spaces {Parameters
| string:String — the string to trim
|
Returns
| String — the trimmed string
|
public static function leftTrimForChar(string:String, char:String):String
Removes all characters at the beginning of the {
Parameters
| string:String — the string to trim
|
| |
| char:String — the character to remove
|
Returns
| String — the trimmed string
|
Throws
| — if you try to remove more than one character
|
public static function leftTrimForChars(string:String, chars:String):String
Removes all characters at the beginning of the {
Parameters
| string:String — the string to trim
|
| |
| chars:String — the characters to remove from the beginning of the { |
Returns
| String — the trimmed string
|
public static function naturalCompare(a:String, b:String, caseSensitive:Boolean = false):int
Natural sort order compare function.
Parameters
| a:String |
| |
| b:String |
| |
| caseSensitive:Boolean (default = false) |
Returns
public static function nthIndexOf(haystack:String, n:uint, needle:String, startIndex:Number = 0):int
Extended String::indexOf
Parameters
| haystack:String — string to search in
|
| |
| n:uint — which ocurance of needle
|
| |
| needle:String — The substring for which to search
|
| |
| startIndex:Number (default = 0) — An optional integer specifying the starting index of the search.
|
Returns
public static function removeAt(string:String, beginIndex:int, endIndex:int):String
Removes a part of the text between 2 positions.
Parameters
| string:String |
| |
| beginIndex:int |
| |
| endIndex:int |
Returns
public static function replaceAt(string:String, value:int, beginIndex:int, endIndex:*):String
Replaces a part of the text between 2 positions.
Parameters
| string:String |
| |
| value:int |
| |
| beginIndex:int |
| |
| endIndex:* |
Returns
public static function rightTrim(string:String):String
Removes all empty characters at the end of a string.
Characters that are removed: spaces {Parameters
| string:String — the string to trim
|
Returns
| String — the trimmed string
|
public static function rightTrimForChar(string:String, char:String):String
Removes all characters at the end of the {
Parameters
| string:String — the string to trim
|
| |
| char:String — the character to remove
|
Returns
| String — the trimmed string
|
Throws
| — if you try to remove more than one character
|
public static function rightTrimForChars(string:String, chars:String):String
Removes all characters at the end of the {
Parameters
| string:String — the string to trim
|
| |
| chars:String — the characters to remove from the end of the { |
Returns
| String — the trimmed string
|
public static function tokenizeToArray(string:String, delimiters:String):Array
Tokenizes a string to an array using the given delimiters.
Parameters
| string:String |
| |
| delimiters:String |
Returns
public static function trim(string:String):String
Removes all empty characters at the beginning and at the end of the passed-in
{
Parameters
| string:String — the string to trim
|
Returns
| String — the trimmed string
|
Spring ActionScript 0.7 - 2009