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 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 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 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
|
Prana Framework 0.6 - 2008