Basic HTML version of Foils prepared 23 June 1997

Foil 41 JavaScript String Methods - I

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo

Examples for String Object in JavaScript for Foil 41
1 The String object has one property:
2 myString.length gives string length in characters
3 JavaScript has only one type of String object, whereas Java has both String (fixed) and StringBuffer (mutable) classes
4 Characters are indexed from the left starting at 0 and ending with myString.length - 1
5 newstring = myString.substring(pos1,pos2);
6 returns the substring in position pos1 ... pos2 - 1
7 Peculiarly, if pos2 < pos1, the previous statement returns the substring in position pos2 ... pos1 - 1

in Table To:


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998