摘要: //String类型//字符串位置方法console.log("字符串位置方法");//indexOf(),lastIndexOf():从一个字符串中搜索给定的子字符串,返回子字符串的位置(没有则返回-1)//用法 string.indexOf(str, location):str为子字符串,location为可选参数,表示从哪个位置开始搜索//indexOf()默认从开头向后搜索,返回第一个字符串的位置//lastIndexOf()默认从末尾向前搜索,返回第一个字符串的位置var stringValue = "hello world!";console 阅读全文
posted @ 2013-06-11 11:32 金帛 阅读(218) 评论(0) 推荐(0)