标签:style blog http io color os ar 使用 java
string.charAt(n);
string.indexOf(substring, startpos);
string.lastIndexOf(substring, startpos);
<html> <body> <script language="JavaScript" type="text/javascript"> var myString="Welcome to Wrox books. "; myString=myString+"The Wrox website is www.Wrox.com. "; myString=myString+"visit the Wrox website today."; var foundAtPosition=0; var wroxCount=0; while(foundAtPosition !=-1) { foundAtPosition=myString.indexOf("Wrox",foundAtPosition); if(foundAtPosition!=-1) { wroxCount++; foundAtPosition++; } } document.write("there are+"wroxCount"+"occurrences of the word Wrox"); </script> </body> </html>
string.substring(startPos, endPos);
字符串
string.substr(startPos, length);
字符串
string.toLowerCase();
返回小写字符串
string.toUpperCase();
大写字符串
var str = "www.dreamdu.com"; document.write(str.toUpperCase());
结果:
WWW.DREAMDU.COM
标签:style blog http io color os ar 使用 java
原文地址:http://www.cnblogs.com/bhlsheji/p/4067523.html