Mega Code Archive

 
Categories / JavaScript DHTML / Language Basics
 

Methods and Properties of the String Object

Method anchor()   Creates an instance of the <a> tag. big()      Converts the string into an instance of the <big> tag. blink()    Converts the string into an instance of the <blink> tag. bold()     Converts the string into an instance of the <bold> tag. charAt()   Returns the character at the index passed to the method. charCodeAt() Returns the ISO-Latin-1 number of the character at the index passed to the method. concat()   Concatenates the two strings passed to return a new string. fixed()    Converts the string into an instance of the <tt> fixed pitch font tag. fontcolor() Sets the color attribute of an instance of the <font> tag. fontsize()  Sets the size attribute of an instance of the <font> tag. fromCharCode() Returns the string value of the ISO-Latin-1 number passed to the method. indexOf()    Returns the index of the first occurrence. italics()    Converts the string into an instance of the <i> tag. lastIndexOf()  Returns the index of the last occurrence. link()       Converts the string into an instance of the <a> tag and sets the href attribute with the URL               that is passed to the method. match()      Returns an array containing the matches based on the regular expression. replace()    Peplace string passed to the method. search()     Returns the index location of the match.               A [ms]1 is returned if the string is not found. slice()      Returns the string between the beginning and ending               indexes passed to the method. If a negative number               is passed, the index is referenced from the end of               the string passed. small()            Converts the string into an instance of the                                  <small> tag. split()            Returns the string split into segments defined by                                   the string and instance limit passed to the method.  strike()           Converts the string into an instance of the <strike> tag. sub()              Converts the string into an instance of the <sub> tag. substr()     Get the sub strng. substring()        Returns the string between the beginning and ending indexes passed to the method. sup()              Converts the string into an instance of the <sup> tag. toLowerCase()     Converts all the characters in the string to lowercase. toSource()        Returns the string representation of the String passed. toString()        Returnsthe characters passed as type String.  toUpperCase()     Converts all the characters in the string to uppercase. Property length            Returns the length of the string. prototype         Add properties to instances of the String object.