1.charAt,charCodeAt
var str:String = "hello world!";
for ( var i: int = 0; i < str.length; i++)
{
        trace(str.charAt(i), "-", str.charCodeAt(i));
}
//charAt(i)得到每个字符.charCodeAt(i)得到字符的编码.
2.substr() 和 substring() 返回字符串的一个子字符串。
var str:String = "Hello from Paris, Texas!!!";
trace(str.substr(11,15)); // 输出:Paris, Texas!!!
trace(str.substring(11,15)); // 输出:Pari
3.slice()
slice() 方法的功能类似于 substring() 方法。但可以使用负整数作为参数,
此时字符位置将从字符串末尾开始向前算起,

var str:String = "Hello from Paris, Texas!!!";
trace(str.slice(11,15)); // 输出:Pari
trace(str.slice(-3,-1)); // 输出:!!
trace(str.slice(-3,26)); // 输出:!!!
trace(str.slice(-3,str.length)); // 输出:!!!
trace(str.slice(-8,-3)); // 输出:Texas
4.indexOf() 和 lastIndexOf()
查找匹配子字符串的字符位置
indexOf() 和 lastIndexOf()在字符串内查找匹配的子字符串,

var str:String = "The moon, the stars, the sea, the land";
trace(str.indexOf( "the")); //输出:10

var str:String = "The moon, the stars, the sea, the land"
trace(str.indexOf( "the", 11)); // 输出:21

lastIndexOf() 方法在字符串中查找子字符串的最后一个匹配项:

var str:String = "The moon, the stars, the sea, the land"
trace(str.lastIndexOf( "the")); // 输出:30

如为 lastIndexOf() 方法提供了第二个参数,搜索将从字符串中的该索引位置反向(从右到左)进行:

var str:String = "The moon, the stars, the sea, the land"
trace(str.lastIndexOf( "the", 29)); // 输出:21
5.split()
创建由分隔符分隔的子字符串数组
split() 方法创建子字符串数组,该数组根据分隔符进行划分。

var queryStr:String = "first=joe&last=cheng&title=manager&StartDate=3/6/65";
var params:Array = queryStr.split( "&", 2); // params == ["first=joe","last=cheng"]

split() 方法的第二个参数是可选参数,该参数定义所返回数组的最大大小。

另 split还支持正则表达式作为分隔符处理,这里不涉及正则处理

在字符串中查找模式并替换子字符串
match() 和 search() 方法可查找与模式相匹配的子字符串。    
replace() 方法可查找与模式相匹配的子字符串并使用指定子字符串替换它们。    
search() 方法返回与给定模式相匹配的第一个子字符串的索引位置。


var str:String = "The more the merrier.";
trace(str.search( "the")); // 输出:9

对于search,match,replace都支持正则表达式匹配处理