a little something from the javascript guide
Code:charAt Method. Returns the character at the specified index. Syntax stringName.charAt(index) Parameters stringName is any string or a property of an existing object. index is any integer from zero to stringName.length - 1, or a property of an existing object. Implemented in Navigator 2.0 Description Characters in a string are indexed from left to right. The index of the first character is zero, and the index of the last character is stringName.length - 1. If the index you supply is out of range, JavaScript returns an empty string. Examples The following example displays characters at different locations in the string "Brave new world": var anyString="Brave new world" document.write("The character at index 0 is " + anyString.charAt(0)) document.write("The character at index 1 is " + anyString.charAt(1)) document.write("The character at index 2 is " + anyString.charAt(2)) document.write("The character at index 3 is " + anyString.charAt(3)) document.write("The character at index 4 is " + anyString.charAt(4))




Reply With Quote