How can I get the character count from a string in ES6?
- 内容介绍
- 文章标签
- 相关推荐
本文共计25个文字,预计阅读时间需要1分钟。
javascriptfunction getLength(str) { return ('' + str).match(/\S+/g).length;}
gistfile1.txtvar GetLength = function(str) { return ('' + str).match(/\S/gu).length; };
本文共计25个文字,预计阅读时间需要1分钟。
javascriptfunction getLength(str) { return ('' + str).match(/\S+/g).length;}
gistfile1.txtvar GetLength = function(str) { return ('' + str).match(/\S/gu).length; };

