StringUtil

Kind of class:class
Inherits from:none
Version:02/27/07
Author:Aaron Clinger, Mike Creighton
Classpath:org.casaframework.util.StringUtil
File last modified:Wednesday, 07 March 2007, 14:18:49

Class methods

addAt

static function addAt (
source:String, position:Number, addition:String) : String
Adds characters at a specific index.
Parameters:
source :
String to add characters to.
position:
Position in which to add characters.
addition:
String to add.
Returns:
String with characters added.

contains

static function contains (
source:String, search:String) : Number
Determines if string contains search string.
Parameters:
source:
String to search in.
search:
String to search for.
Returns:
Returns the frequency of the search term found in source string.

getNumbersFromString

static function getNumbersFromString (
source:String) : String
Removes all non numeric characters from string.
Parameters:
source:
String to return numbers from.
Returns:
String containing only numbers.

getUniqueCharacters

static function getUniqueCharacters (
source:String) : String
Extracts all the unique characters from a source String.
Parameters:
source:
String to find unique characters within.
Returns:
String containing unique characters from source String.

remove

static function remove (
source:String, remove:String) : String
Removes characters from a source string.
Parameters:
source:
String to remove characters from.
remove:
String describing characters to remove.
Returns:
String with characters removed.

removeAt

static function removeAt (
source:String, position:Number) : String
Removes a character at a specific index.
Parameters:
source :
String to remove character from.
position:
Position of character to remove.
Returns:
String with character removed.

removeExtraSpaces

static function removeExtraSpaces (
source:String) : String
Removes extra white space from string.
Parameters:
source:
String to remove extra spaces from.
Returns:
String with additional spaces removed.

removeNumbersFromString

static function removeNumbersFromString (
source:String) : String
Removes all numeric characters from string.
Parameters:
source:
String to remove numbers from.
Returns:
String with numbers removed.

replace

static function replace (
source:String, remove:String, replace:String) : String
Replaces target characters with new characters.
Parameters:
source :
String to replace characters from.
remove :
String describing characters to remove.
replace:
String to replace removed characters.
Returns:
String with characters replaced.

replaceAt

static function replaceAt (
source:String, position:Number, replace:String) : String
Replaces a character at a specific index with new characters.
Parameters:
source :
String to replace characters from.
position:
Position of character to replace.
replace :
String to replace removed character.
Returns:
String with character replaced.

toTitleCase

static function toTitleCase (
source:String) : String
Transforms source string to per word capitalization.
Parameters:
source:
String to return as title cased.
Returns:
String with capitalized words.