Main Page | Packages | Class Tree | Index | Help

xp.util

class StringUtils

Object
  |
  +--xp.util.StringUtils


class StringUtils
extends Object

String utilities class

Various string utilities


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Method Summary

public static
argbToHex ( n: Number ): String
Converts an argb color to hex string

public static
csvToArray ( str: String ): Array
Convert a simple CSV row string to an array

public static
ellipsis ( str: String, maxlen: Number )
Formats a string to use ellipsis (...) if it exceeds maxlen

public static
escapeHTML ( str: String )
Escape HTML string

public static
formatNationalPhoneNumber ( p: String ): String
Formats an national phone number

public static
formatPhoneNumber ( p: String ): String
Formats an international phone number

public static
isDigit ( ch ): Boolean
Determines if the character is a digit

public static
isSpace ( ch ): Boolean
Determines if the character is a space character

public static
normalize ( str: String ): String
Normalize whitespace in a string

public static
replace ( str: String, findStr: String, replaceStr: String ): String
Replace text in a string with other text

public static
rgbToHex ( n: Number ): String
Converts an rgb color to hex string

public static
strip ( str: String, findStr: String ): String
Strps all instance of findStr from a string

public static
stripSpace ( str: String ): String
Strip space from a string

public static
trim ( str: String ): String
Left and Right Trims a string of whitespace

public static
unescapeHTML ( str: String )
Unescape HTML string

public static
zeroPad ( num: Number, digits: Number, trailing: Boolean ): String
zero pads a string



Method Documentation

argbToHex

public static function argbToHex(n: Number): String
Converts an argb color to hex string

Parameters:
n
The number to convert
Returns:
The formatted string

csvToArray

public static function csvToArray(str: String): Array
Convert a simple CSV row string to an array

Parameters:
str
to be processed

ellipsis

public static function ellipsis(str: String,
 maxlen: Number)
Formats a string to use ellipsis (...) if it exceeds maxlen

Parameters:
str
The string to be formatted
maxlen
The maximum visble length of the string required

escapeHTML

public static function escapeHTML(str: String)
Escape HTML string

Parameters:
str
to be processed

formatNationalPhoneNumber

public static function formatNationalPhoneNumber(p: String): String
Formats an national phone number

Parameters:
p
The phone number to format
Returns:
The formatted phone number

formatPhoneNumber

public static function formatPhoneNumber(p: String): String
Formats an international phone number

Parameters:
p
The phone number to format
Returns:
The formatted phone number

isDigit

public static function isDigit(ch): Boolean
Determines if the character is a digit

Parameters:
ch
Character to be processed
Returns:
True if the charactre is a digit

isSpace

public static function isSpace(ch): Boolean
Determines if the character is a space character

Parameters:
ch
Character to be processed
Returns:
True if the charactre is a digit

normalize

public static function normalize(str: String): String
Normalize whitespace in a string

Parameters:
str
to be processed

replace

public static function replace(str: String,
 findStr: String,
 replaceStr: String): String
Replace text in a string with other text

Parameters:
str
The string to be processed
findStr
What to find in str
replaceStr
The text to replace findStr

rgbToHex

public static function rgbToHex(n: Number): String
Converts an rgb color to hex string

Parameters:
n
The number to convert
Returns:
The formatted string

strip

public static function strip(str: String,
 findStr: String): String
Strps all instance of findStr from a string

Parameters:
str
to be processed
findStr

stripSpace

public static function stripSpace(str: String): String
Strip space from a string

Parameters:
str
to be processed

trim

public static function trim(str: String): String
Left and Right Trims a string of whitespace

Parameters:
str
The string to be trimmed

unescapeHTML

public static function unescapeHTML(str: String)
Unescape HTML string

Parameters:
str
to be processed

zeroPad

public static function zeroPad(num: Number,
 digits: Number,
 trailing: Boolean): String
zero pads a string

Parameters:
num
number - the number to pad
digits
- the number of digits to pad to & @param trailing - controls whether the padding is prefixed or suffixed
trailing
Returns:
The formatted string


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc