- stringvar.substr(start [, length ])
'hello world'.substr(1,1) //e
- stringvar.substring(start, end)
"hello world".substring(1,3) // el
'hello world'.substr(1,1) //e
"hello world".substring(1,3) // el
本文标题:JS中substr和substring的用法和区别
本文链接:https://www.haomeiwen.com/subject/uwubcftx.html
网友评论