js如何利用正则表达式截取指定长度字符串Javascript 字符串上的方法(性能好)var str = "It's a long string."var length = 10console.log( str.slice( 0, length )2023-02-18JavaScript270