Jaxer.Util.String : Object
Return to: Jaxer Framework index

Namespace that holds functions and other objects that extend JavaScript's string capabilities.

Platform Support

Jaxer Server FrameworkJaxer Client Framework
1.0no

Functions

MethodActionJaxer Server FrameworkJaxer Client Framework
static endsWith(String inString, String lookFor, Boolean ignoreCase) : Boolean
Check to see if a string ends with a string
Show Details1.0no

Parameters
StringinStringThe string to look in
StringlookForThe string to look for
BooleanignoreCaseSet to true for case insensitive searches

Returns
Booleantrue if the string ends with the provided string

static escapeForJS(String raw) : String
Escapes an input string for use with javascript
Show Details1.0no

Parameters
StringrawThe source string

Returns
StringThe escaped string suitable for use in an eval statement

static escapeForSQL(String raw) : String
Escapes an input string for use with SQL
Show Details1.0no

Parameters
StringrawThe source string

Returns
StringThe escaped string suitable for use in a SQL query

static grep(String stringOrArray, String pattern) : String[]
Searches the given lines for the given pattern, and returns the lines that matched.
Show Details1.0no

Parameters
StringstringOrArrayThe string to search through, which will be split up into its lines, or an array of lines (i.e. a string that has already been split)
StringpatternThe string pattern to look for, which will be turned into a RegExp, or the RegExp to match

Returns
String[]An array of the lines that matched the pattern

static singleQuote(String text) : String
Surround the provided string in single quotation marks
Show Details1.0no

Parameters
StringtextThe original string

Returns
StringThe original string encased in single quotes

static startsWith(String inString, String lookFor, Boolean ignoreCase) : Boolean
Check to see if a string starts with another string
Show Details1.0no

Parameters
StringinStringThe string to look in
StringlookForThe string to look for
BooleanignoreCaseSet to true for case insensitive searches

Returns
Booleantrue if the string starts with the provided string

static trim(String str, [String charsToTrim,] [String leftOrRight]) : String
Left or right trim the provided string. Optionally, you can specify a list of characters (as a single string) to trim from the source string. By default, whitespace is removed. Also, you can control which side of the string (start or end) is trimmed with the default being both sides.
Show Details1.0no

Parameters
StringstrThe source string
StringcharsToTrim(optional)This optional parameter can be used to specify a list of characters to remove from the sides of the source string. Any combination of these characters will be removed. If this parameter is not specified, then all whitespace characters will be removed.
StringleftOrRight(optional)This optional parameter can be used to control which side of the string is trimmed. A value of "L" will trim the start of the string and all other string values will trim the end of the string. If this parameter is not specified, then both sides of the string will be trimmed

Returns
StringThe resulting trimmed string

static upperCaseToCamelCase(String orig) : String
Convert a string to a CamelCase representation by removing interword spaces and capitalizing the first letter of each word following an underscore
Show Details1.0no

Parameters
StringorigThe orignal string containing underscores between words

Returns
StringThe resulting string with underscores removed and the first letter of a word capitalized

aptana_docs