Make your own free website on Tripod.com

Data Types - Strings


Special characters in string

Character Description
\n new line
\t tab
\r carriage return
\f form feed
\b backspace

Operators

Properties

Property Description
length An integer value containing the length of the string expressed as the number of characters in the string.

Methods (built-in functions)

Method Description
anchor(name) Returns a string containing the value of the string object surrounded by an A container tag with the NAME attribute set to name.
big() Return a string containing the value of the string object surrounded by a BIG container tag.
blink() Returns a string containing the value of the string object surrounded by a BLINK container tag.
bold() Returns a string containing the value of the string object surrounded by a B container tag.
charAt(index) Returns the character at the location specified by index.
fixed() Returns a string containing the value of the string object surrounded by a FIXED container tag.
fontColor(colour) Returns a string containing the value of the string object surrounded by a FONT container tag with the COLOR attribute set to color where color is a color name or RGB triplet.
fontSize(size) Returns a string containing the value of the string object surrounded by a FONTSIZE container tag with the size set to size.
indexof(findString,startIndex) Returns the index of the first occurrence of findString, starting the search at startingIndex where startingIndex is optional - if it is not provided, the search starts at the start of the string.
italics() Returns a string containing the value of the string object surrounded by an I container tag.
lastIndexOf(findString,startingIndex) Returns the index of the last occurrence of findstring. This is done by seaching backwards from startingIndex. StartingIndex is optional and assumed to be the last charatr nthe tring if no value is provided.
link(href) Return a string containing the value of the string object surrounded by an A container tag with the HREF attribute set to href.
small() Returns a string containgin the value of the string object surrounded by a SMALL container tag.
strike() Returns a string containing the value of the string object surrounded by a STRIKE container tag.
sub() Returns a string containing the value o the string object surrounded by a SUB container tag.
substring(firstIndex,lastIndex) Returns a string equivalent to the substring starting at firstIndex and ending at the character before lastIndex. If firstIndex is greater than lastIndex, the string starts at lastIndex and ends at the character before firstIndex.
sup() Returns a string containing the value of the strin ojct surounded by a SUP container tag.
toLowerCase() Returns a string containing the value f the string object with all characters converted to lower case.
toUpperCase() Returns a string containing the value of the string object with all characters converted to upper case.

Back