Changes

Jump to: navigation, search

JavaScript String Object

498 bytes added, 19:20, 26 April 2007
Creating a JavaScript String Object
</pre>
 
JavaScript String object methods and properties are accessed using the standard object dot notation:
 
''objectName.property'' accesses a property. For example:
 
<pre>
 
var stringLen = myString.length;
 
</pre>
 
returns the length of the string and assigns it to the variable ''stringLen''
 
Similarly:
 
<pre>
 
var position = myString.indexOf ("my");
 
</pre>
 
returns the postion index of the word ''my'' in the string (the word my begins position 8 because the first character is index position 0).

Navigation menu