String(Extensions)

The String has been extended with many functions.

Static Functions

Compare(String strA, String strB) Number Creates numerical values of the ASCII values of the characters. Returns 1 if strA > strB, 0 if strA == strB and –1 if strA < strB  
Format(String formatSring, Object object) String Binds with a provided formatString using binding expressions between {} to pull values from; In depth
Format(String formatSring, params…) String The provided formatString is any string using the syntax {#} where # is a number for a place holder value. The params provided will replace the placeholders in the order the parameters appear.  

Fields

Type Type Returns Type.Dictionary

Functions

Compare(String strA) Number Creates numerical values of the ASCII values of the characters. Returns 1 if string > strA, 0 if string == strA and –1 if string < strA.
Contains(String str) Boolean Returns whether the str provided occurs anywhere in the current string.
Decode() String Returns a url decoded version of the string.
Encode() String Returns a url encoded version of the string.
EndsWith(String str) Boolean Returns true if the end of the string matches the provided string.
IndexOf(String str) Number Returns the index of the first appearance of the string. If it is not found, returns –1.
IndexOf(String str, Number start) Number Returns the index of the first appearance of the string after the given index. If it is not found, returns –1.
Insert(Number index, String str) String Returns a copy of the string with the str inserted into the calling string at the given index.
IsDate() Boolean Returns whether the string is a valid date.
IsDateTime() Boolean Returns whether the string is a valid DateTime.
IsFloat() Boolean Returns whether the string is a valid floating point number.
IsInt() Boolean Returns whether the string is a valid integer.
IsTime() Boolean Returns whether the string is a valid time.
LastIndexOf(String str) Number Returns the index of the last appearance of the string. If it is not found, returns –1.
LastIndexOf(String str, Number start) Number Returns the index of the last appearance of the string before the given index. If it is not found, returns –1.
Remove(String token) String Returns a copy of the string with the first instance of the token removed.
RemoveAll(String token) String Returns a copy of the string with all instances of the token removed.
RemoveSubstring(Number start) String Returns a copy of the string with the portion from the given start to the end removed.
RemoveSubstring(Number start, Number end) String Returns a copy of the string with the portion from the given start to the given end removed.
Replace(String token, String str) String Returns a copy of the string with all occurrences of the token replaced with the str.
Replace(String token, String str, Boolean ignore) String Returns a copy of the string with all occurrences of the token replaced with the str and if ignore is set to true, the match is case insensitive.
Split(String token) Array Returns an array strings where the original string is split on the given token.
StartsWith(String str) Boolean Returns true if the start of the string matches the provided string.
Substring(Number start) String Returns a copy of the string from the given start index to the end.
Substring(Number start, Number end) String Returns a copy of the string from the given start to the given end. If the end goes beyond the string length, the returned string goes to the end.
ToBoolean() Boolean Converts the string to a Boolean value.
ToColor() Color Converts the string to a Color type value.
ToDateTime() DateTime Converts the string to a DateTime.
ToFloat() Number Converts the string to a Number.
ToInt() Number Converts the string to an integer number.
ToIntFromHex() Number Converts the string to a number represented by hexadecimal.
ToLower() String Returns a copy of the string in lower case.
ToUpper() String Returns a copy of the string in upper case.
Trim() String Returns a copy of the string without leading or trailing white spaces.
TrimLeft() String Returns a copy of the string without leading white spaces.
TrimRight() String Returns a copy of the string without trailing white spaces.

Last edited Sep 18, 2011 at 2:33 PM by dahrkdaiz, version 5

Comments

No comments yet.