摘要: var test = 'hello world'; alert(test.slice(4,7)); //o w alert(test.substring(4,7)); //o w alert(test.substr(4,7)); //o world这里有个需要注意的地方就是:substring是以两个参数中较小一个作为起始位置,较大的参数作为结束位置。var test = 'hello world'; alert(test.slice(-3)); //rld alert(t... 阅读全文