Entities of type String are collections of zero or more Unicode characters.
A string is arranged so that the characters in it can be accessed by their position. The leftmost character is considered to be at position 0 and the right most character is therefore at a position whose value is one less than the length of the string.
This is convenient when processing strings in a for() loop since you can check the enumerator against the length and as long as it is less than the length and is a positive value, it is indexing within the string.
Zero length strings are a special case.
Strings can only be accessed read-only. You cannot change the contents of a string, you can only replace it with another.
ECMA 262 edition 2 - section 4.3.17
ECMA 262 edition 2 - section 6
ECMA 262 edition 2 - section 8.4
ECMA 262 edition 3 - section 4.3.17
ECMA 262 edition 3 - section 8.4
O'Reilly JavaScript Definitive Guide - page 38
O'Reilly JavaScript Definitive Guide - page 50
Prev | Home | Next |
STRIKE object | Up | String |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |