Packagestarling.utils
Classpublic class StringUtil
InheritanceStringUtil Inheritance Object

A utility class with methods related to the String class.



Public Methods
 MethodDefined By
  
clean(string:String):String
[static] Replaces a string's "master string" — the string it was built from — with a single character to save memory.
StringUtil
  
format(format:String, ... args):String
[static] Formats a String in .Net-style, with curly braces ("{0}").
StringUtil
  
parseBoolean(value:String):Boolean
[static] Returns true if value equals true, TRUE, True, or 1.
StringUtil
  
trim(string:String):String
[static] Removes all leading and trailing white-space and control characters from the given String.
StringUtil
  
trimEnd(string:String):String
[static] Removes all trailing white-space and control characters from the given String.
StringUtil
  
trimStart(string:String):String
[static] Removes all leading white-space and control characters from the given String.
StringUtil
Method Detail
clean()method
public static function clean(string:String):String

Replaces a string's "master string" — the string it was built from — with a single character to save memory. Find more information about this AS3 oddity here.

Parameters

string:String — The String to clean

Returns
String — The input string, but with a master string only one character larger than it.
format()method 
public static function format(format:String, ... args):String

Formats a String in .Net-style, with curly braces ("{0}"). Does not support any number formatting options yet.

Parameters

format:String
 
... args

Returns
String
parseBoolean()method 
public static function parseBoolean(value:String):Boolean

Returns true if value equals true, TRUE, True, or 1.

Parameters

value:String

Returns
Boolean
trim()method 
public static function trim(string:String):String

Removes all leading and trailing white-space and control characters from the given String.

Beware: this method does not make a proper Unicode white-space check, but simply trims all character codes of '0x20' or below.

Parameters

string:String

Returns
String
trimEnd()method 
public static function trimEnd(string:String):String

Removes all trailing white-space and control characters from the given String.

Beware: this method does not make a proper Unicode white-space check, but simply trims all character codes of '0x20' or below.

Parameters

string:String

Returns
String
trimStart()method 
public static function trimStart(string:String):String

Removes all leading white-space and control characters from the given String.

Beware: this method does not make a proper Unicode white-space check, but simply trims all character codes of '0x20' or below.

Parameters

string:String

Returns
String