A string of characters.

Syntax

[<oRef> =] new String([<expC>])

<oRef>

A variable or property in which you want to store a reference to the newly created String object.

<expC>

The string you want to create. If omitted or null, the resulting string is empty.

Properties

The following tables list the properties and methods of the String class. (No events are associated with this class.)

Property

Default

Description

baseClassName

className

STRING

STRING

Identifies the object as an instance of the String class

Identifies the object as an instance of the String class

length

 

The number of characters in the string

string

 

The value of the String object

Method

Parameters

Description

anchor( )

<expC>

Tags the string as an anchor <A NAME>

asc( )

<expC>

Returns the ASCII value of the first character in the designated string

big( )

 

Tags the string as big <BIG>

blink( )

 

Tags the string as blinking <BLINK>

bold( )

 

Tags the string as bold <BOLD>

charAt( )

<index expN> 

Returns the character in the string at the designated position

chr( )

<expN>

Returns the character equivalent of the specified ASCII value

fixed( )

 

Tags the string as fixed font <TT>

fontcolor( )

<expC>

Tags the string as the designated color

fontsize( )

<expN>

Tags the string as the designated font size

getByte( )

<index expN>

Returns the value of the byte at the specified index in the string

indexOf( )

<expC>
[, <start index expN>]

Returns the position of the search string inside the string

isAlpha( )

 

Returns true if the first character of the string is alphabetic

isLower( )

 

Returns true if the first character of the string is lowercase

isUpper( )

 

Returns true if the first character of the string is uppercase

italics( )

 

Tags the string as in italics <I>

lastIndexOf( )

<expC>
[, <start index expN>]

Returns the position of the search string inside the string, searching backwards

left( )

<expN>

Returns the specified number of characters from the beginning of the string

leftTrim( )

 

Returns the string with all leading spaces removed

link( )

<expC>

Tags the string as a link <A HREF>

replicate( )

<expC>
[, <expN>]

Returns the specified string repeated a number of times

right( )

<expN>

Returns the specified number of characters from the end of the string

rightTrim( )

 

Returns the string with all trailing spaces removed

setByte( )

<index expN>,
<value expN>

Assigns a new value to the byte at the specified index in the string

small( )

 

Tags the string as small <SMALL>

space( )

<expN>

Returns a string comprising the specified number of spaces

strike( )

 

Tags the string as strikethrough <STRIKE>

stuff( )

<start expN>
, <quantity expN>
[, <replacement expC>]

Returns the string with specified characters removed and others inserted in their place

sub( )

 

Tags the string as subscript <SUB>

substring( )

<start index expN>
, <end index expN>

Returns a substring derived from the string

sup( )

 

Tags the string as superscript <SUP>

toLowerCase( )

 

Returns the string in all lowercase

toProperCase( )

 

Returns the string in proper case

toUpperCase( )

 

Returns the string in all uppercase

 

Description

A String object contains the actual string value, stored in the property string, and methods that act upon that value. The methods do not modify the value of string; they use it as a base and return another string, number, or true or false.

The methods are divided into three categories: those that simply wrap the string in HTML tags, those that act upon the contents of the string, and static class methods that do not operate on the string at all.

Because the return values for most string methods are also strings, you can call more than one method for a particular string by chaining the method calls together. For example,

cSomething.substring( 4, 7 ).toUpperCase( )