Zebra0

Learn to Program Step-by-Step

The String Class

Strings


Get Adobe Flash player

The String class is built-in to Flash. Just as there are many operations we can do with numbers, such as adding and subtracting, there are many operations we can do with Strings.

  • Start a new ActionScript 3 file.
  • In the ActionScript window declare a String variable with an initial value:

var s:String="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
trace(s.

When you type s. the list of methods will appear.
fsh
Type trace(s.charAt(3));

You will see the letter D in the output window. Like most things in computers, numbering starts with 0.  Thus, s.charAt(0) is the letter A.


INDEX, The String Class, String Functions, Anagrams, Cryptograms
Next lesson: XML