StringTools

class StringToolsAvailable in flash8, flash, neko, js, php, cpp, cs, javaThe StringTools class contains some extra functionalities for String manipulation. It's stored in a different class in order to prevent the standard String of being bloated and thus increasing the size of each application using it. static function endsWith( s : String, end : String ) : BoolTells if the string s ends with the string end. static inline function fastCodeAt( s : String, index : Int ) : IntProvides a fast native string charCodeAt access. Since the EOF value might vary depending on the platforms, always test with StringTools.isEOF. Only guaranteed to work if index in 0,s.length range. Might not work with strings containing \0 char. static function hex( n : Int, ?digits : Int ) : StringEncode a number into a hexadecimal representation, with an optional number of zeros for left padding. static function htmlEscape( s : String, ?quotes : Bool ) : StringEscape HTML special characters of the string. static function htmlUnescape( s : String ) : StringUnescape HTML special characters of the string. static inline function isEof( c : Int ) : Bool static function isSpace( s : String, pos : Int ) : BoolTells if the character in the string s at position pos is a space. static function lpad( s : String, c : String, l : Int ) : StringPad the string s by appending c at its left until it reach l characters. static function ltrim( s : String ) : StringRemoves spaces at the left of the String s. static function replace( s : String, sub : String, by : String ) : StringReplace all occurences of the string sub in the string s by the string by. static function rpad( s : String, c : String, l : Int ) : StringPad the string s by appending c at its right until it reach l characters. static function rtrim( s : String ) : StringRemoves spaces at the right of the String s. static function startsWith( s : String, start : String ) : BoolTells if the string s starts with the string start. static function trim( s : String ) : StringRemoves spaces at the beginning and the end of the String s. static function urlDecode( s : String ) : StringDecode an URL using the standard format. static function urlEncode( s : String ) : StringEncode an URL by using the standard format.
version #17660, modified 2013-02-25 00:00:28 by api
0 comment