haXe API Documentation
Back | Index
class StringTools
Available in flash, neko, js
The 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 baseDecode(s : String, base : String) : String
Decode a string encoded in the specified base. The base length must be a power of two.
static function baseEncode(s : String, base : String) : String
Encode a string using the specified base. The base length must be a power of two.
static function endsWith(s : String, end : String) : Bool
Tells if the string s ends with the string end.
static function hex(n : Int, ?digits : Int) : String
Encode a number into a hexadecimal representation, with an optional number of zeros for left padding.
static function htmlEscape(s : String) : String
Escape HTML special characters of the string.
static function htmlUnescape(s : String) : String
Unescape HTML special characters of the string.
static function isSpace(s : String, pos : Int) : Bool
Tells if the character in the string s at position pos is a space.
static function lpad(s : String, c : String, l : Int) : String
Pad the string s by appending c at its left until it reach l characters.
static function ltrim(s : String) : String
Removes spaces at the left of the String s.
static function replace(s : String, sub : String, by : String) : String
Replace all occurences of the string sub in the string s by the string by.
static function rpad(s : String, c : String, l : Int) : String
Pad the string s by appending c at its right until it reach l characters.
static function rtrim(s : String) : String
Removes spaces at the right of the String s.
static function startsWith(s : String, start : String) : Bool
Tells if the string s starts with the string start.
static function trim(s : String) : String
Removes spaces at the beginning and the end of the String s.
static function urlDecode(s : String) : String
Decode an URL using the standard format.
static function urlEncode(s : String) : String
Encode an URL by using the standard format.
Back | Index