
1、indexof方法从字符串开始向后搜索子字符串。
2、lastIndexof方法是从字符串末尾搜索子字符串。
3、trim将创建一个字符串副本,删除前置和后缀的所有空格,然后返回结果。
实例
<scripttype="text/javascript">
varstr="Helloworld!";
document.write(str.indexOf("Hello")+"<br/>");
document.write(str.indexOf("World")+"<br/>");
document.write(str.indexOf("world"));
</script>原文来自:https://www.py.cn © 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
















































暂无评论内容