字符串替换:
var str="Visit Microsoft!"
document.write(str.replace(/Microsoft/,"W3School"))
![](https://img.haomeiwen.com/i1860174/6d8cef6e35852a58.png)
字符串长度:
str.length
字符串位置:
document.write(str.indexOf("M")
查找字符串中特殊字符
document.write(str.match("world")
document.write(str.match("World")
document.write(str.match("worlld")
document.write(str.match("world!")
world null null world!
var s = "aaa";
document.write(s.big());
document.write(s.small());
document.write(s.blink());
document.write(s.fontcolor('red'));
document.write(s.fontsize(5));
网友评论