JavaScript has an Object type String that can be used to perform various types of string functions such as substring, upper case, lower case, font styles, index of characters etc.

JavaScript String Function Examples

First of all to start with String Object Functions. See the following javascript code to create a variable of String type:

var myString = new String();
myString = "JavaScript String Function";

myString variable is assigned a string to perform the string functions:

String Anchor Function

Anchor function creates the HTML anchor.

Syntax
stringObject.anchor([name]);
Example
document.write( myString.anchor("topAnchor") );

String Big Function

Displays the string in Big font style.

Example
document.write( myString.big() );

String Blink Function

Blinks the displayed string. It does not work in Internet explorer.

Example
document.write( myString.blink() );

String Bold Function

Displays the bold fonts in string.

Example
document.write( myString.bold() );

String charAt Function

Displays the character at specified position of string.

Syntax
stringObject.charAt(index);
Example
document.write( myString.charAt(11) );
Output

S

String charCodeAt Function

Displays the Unicode of the character at the specified position of string.

Syntax
stringObject.charCodeAt(index);
Example
document.write( myString.charCodeAt(11) );
Output

83

Continue to next tutorial: JavaScript String Object Functions-2 to learn some more string functions.

Recent JavaScript Tutorials

Javascript FSO ShortPath property

Javascript FileSystemObject (FSO) provides a ShortPath property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Path Property

Javascript FileSystemObject (FSO) provides the Path property that can be accessed through the file object or folder object returned by the GetFile or GelFolder method

Javascript FSO Type property

Javascript FileSystemObject (FSO) provides a Type property that can be accessed through file object or folder object returned by the GetFile or GetFolder method

Javascript FSO ShortName property

Javascript FileSystemObject (FSO) provides a ShortName property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Name Property

Javascript FileSystemObject (FSO) provides a Name property that can be accessed using file object or folder object.