Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript String Object

The String object enables manipulation and formatting of text strings and determination and location of substrings within strings.

Methods: JScript String Object

JScript String Object anchor Method

Places an HTML anchor tag (<A>) with a NAME attribute around text.

JScript String Object big Method

Places HTML <BIG> tags around text.

JScript String Object blink Method

Places HTML <BLINK> tags around text.

JScript String Object bold Method

Places HTML <B> tags around text.

JScript String Object charAt Method

Retrieves the character as the specified index.

JScript String Object charCodeAt Method

Returns the Unicode encoding of the specified character.

JScript String Object concat Method

Combines two strings into one String object.

JScript String Object fixed Method

Places HTML <TT> tags around text.

JScript String Object fontcolor Method

Places an HTML <FONT> tag with the COLOR attribute around text.

JScript String Object fontsize Method

Places an HTML <FONT> tag with the SIZE attribute around text.

JScript String Object fromCharCode Method

Creates a string from a number of Unicode character values.

JScript String Object indexOf Method

Finds the first occurrence of a substring within a String object.

JScript String Object italics Method

Places HTML <I> tags around text.

JScript String Object lastIndexOf Method

Finds the last occurrence of a substring.

JScript String Object link Method

Places an HTML anchor tag (<A>) with an HREF attribute around text.

JScript String Object match Method

Performs a search on a string using the supplied Regular Expression object.

JScript String Object replace Method

Replaces the text found by a regular expression with other text.

JScript String Object search Method

Searches a string for matches to a regular expression.

JScript String Object slice Method

Returns a section of a string.

JScript String Object small Method

Places HTML <SMALL> tags around text.

JScript String Object split Method

Removes text from a string.

JScript String Object strike Method

Places HTML <STRIKE> tags around text.

JScript String Object sub Method

Places HTML <SUB> tags around text.

JScript String Object substr Method

Returns a substring beginning at a specified location and having a specified length.

JScript String Object substring Method

Returns the substring at a specified location.

JScript String Object sup Method

Places HTML <SUP> tags around text.

JScript String Object toLowerCase Method

Converts text to lowercase letters.

JScript String Object toUpperCase Method

Converts text to uppercase letters.

Properties: JScript String Object

JScript String Object length Property

The length of a String object.

Syntax: JScript String Object

StringObj[.method]

"String Literal"[.method]

Arguments: JScript String Object

method

A String object method.

Remarks: JScript String Object

String objects can be created implicitly using string literals. String objects created in this fashion (referred to as standard strings) are treated differently than String objects created using the new operator. All string literals share a common, global string object. So, if a property is added to a string literal, it is available to all standard string objects:

var alpha, beta;

alpha = "This is a string";

beta = "This is also a string";

alpha.test = 10;

In this example, test is now defined for beta and all future string literals. In the following example, however, added properties are treated differently:

var gamma, delta;

gamma = new String("This is a string");

delta = new String("This is also a string");

gamma.test = 10;

In this case, test is not defined for delta. Each String object declared as a new String object has its own set of members. This is the only case where String objects and string literals are handled differently.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.