String Class Extensions

Provides various extensions to the JavaScript String class.

Class Members

MemberDescription

extract

Function that extracts a string from within another string based on two delimiters. The function operates case insensitively and the string returned by default returns the value between the first set of matched delimiters.

o.String.extract(startDelim, endDelim, allowMissingEndDelim, returnDelims)

format

Provides a very simplistic C# like string.Format functionality.

String.format(formatString)

htmlEncode

HTML encodes an HTML string ensuring that HTML is displayed as text.

o.String.htmlEncode()

padL

Pads a string to the left with the specified character.

o.String.padL(width,pad)

padR

Pads a string on the right with a given pad character.

o.String.padR(width,pad)

repeat

Static string extension that allows creating a repeated string.

String.repeat(chr,count)

startsWith

Determines if a string starts with a given character substring.

o.String.startsWith(substr,nocase)

trimEnd

Trims white space off the end of a string.

o.String.trimEnd()

trimStart

Trims white space off the beginning of a string.

o.String.trimStart()

See also:

Class String

© West Wind Technologies, 1996-2018 • Updated: 02/27/16
Comment or report problem with topic