在 JavaScript 中,对于字符串的操作有 substring, substr, slice 等好多个内置函数,这里给大家推荐一篇介绍 substring, substr, slice 三者区别的文章. Extracting a portion of a string is a fairly well understood practice. With JavaScript, there are three different built-in functions which can pe…