Javascript strings reference.
Javascript build-in String object reference.
Create strings:
Prototype Methods:
Syntax: | charAt(index) |
This method returns a one-character string from index position in a string.
All characters in a string has an index starting with 0 as the first character and length-1 as the last character. In some implementations you can use a different notation, string [index], to achieve the same. |
|
Return value: | A primitive string. |
index: | This is the index of the character that should be returned from a string. |
An example of using the charAt() :
|
Constructor (String) Methods:
Syntax: | String.fromCharCode(c1,c2, ...) |
Returns a string containing as many characters as the number of arguments.
Each argument specifies one character of the resulting string, with the first argument specifying the first character, and so on, from left to right. |
|
Return value: | A primitive string. |
c1,c2, ... : | One or more codes that will be converted to characters. |
An example of using the fromCharCode() :
|
Prototype Properties:
Syntax: | String.prototype.constructor |
This property of the String.prototype holds the reference back to the String object. | |
Important note: | This is the same as the constructor property of an instantiated object |
Constructor (String) Properties:
Syntax: | String.constructor |
The constructor property is a reference to the function that will be invoked to create a String object. |
© 2010 by Finnesand Data.
All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.