class String
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 |
STRING STRING |
Identifies the object as an instance of the String class Identifies the object as an instance of the String class | |
|
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> |
<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> |
<index expN> |
Returns the character in the string at the designated position | |
<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 |
<index expN> |
Returns the value of the byte at the specified index in the string | |
<expC> |
Returns the position of the search string inside the string | |
|
Returns true if the first character of the string is alphabetic | |
|
Returns true if the first character of the string is lowercase | |
|
Returns true if the first character of the string is uppercase | |
italics( ) |
|
Tags the string as in italics <I> |
<expC> |
Returns the position of the search string inside the string, searching backwards | |
<expN> |
Returns the specified number of characters from the beginning of the string | |
|
Returns the string with all leading spaces removed | |
link( ) |
<expC> |
Tags the string as a link <A HREF> |
<expC> |
Returns the specified string repeated a number of times | |
<expN> |
Returns the specified number of characters from the end of the string | |
|
Returns the string with all trailing spaces removed | |
<index expN>, |
Assigns a new value to the byte at the specified index in the string | |
small( ) |
|
Tags the string as small <SMALL> |
<expN> |
Returns a string comprising the specified number of spaces | |
strike( ) |
|
Tags the string as strikethrough <STRIKE> |
<start expN> |
Returns the string with specified characters removed and others inserted in their place | |
sub( ) |
|
Tags the string as subscript <SUB> |
<start index expN> |
Returns a substring derived from the string | |
sup( ) |
|
Tags the string as superscript <SUP> |
|
Returns the string in all lowercase | |
|
Returns the string in proper case | |
|
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( )