JS中类似PHP中的strrpos\substr的函数--可用
2014-06-04 20:35
281 查看
<html> <body> <script type="text/javascript"> var str="Hello world!" document.write(str.lastIndexOf("Hello") + "<br />") document.write(str.lastIndexOf("World") + "<br />") document.write(str.lastIndexOf("world")) </script> </body> </html>
<html>
<body>
<script type="text/javascript">
var str="Hello world!"
document.write(str.substring(3))
</script>
</body>
</html>
lastIndexOf
substring
相关文章推荐
- js实现类似php中strtotime函数和timetostr的日期转换/互换功能
- php 类似 js indexof与lastindexof 的方法 : strpos() strrpos()
- js实现类似php中strtotime函数和timetostr的日期转换/互换功能
- Js:关于document.execCommand()函数可用参数大解析
- 网上的一个PHP分页函数,测试可用
- php截取中文字符串长度的mb_substr()、mb_strcut()函数 附strlen/mb_strlen
- JS与PHP向函数传递可变参数的区别
- Access2003中使用 无限分类 模块函数,可用在查询中 类似SQL的存储过程
- 用在PHP里的JS打印函数
- PHP检查库或函数是否可用的方法
- PHP substr() 函数
- PHP substr()函数的几个程序应用
- 网上的一个PHP分页函数,测试可用
- PHP 中检查库或函数是否可用的方法
- 用js进行url编码后用php反解以及用php实现js的escape功能函数
- 将PHP数组赋值给JS通过php系统函数json_encode()来实现
- 网上的一个PHP分页函数,测试可用
- PHP - Manual手册 - CLXI. String 字符串处理函数 - substr返回字符串中的一部分
- JS实现的PHP语法加亮函数
- php模拟js escape(unescape)函数整理