Simple life, Complicated mind
Sunday, May 13, 2018
String length in bytes in JavaScript
String length in bytes in JavaScript
(new TextEncoder('utf-8').encode('foo')).length
Reference:
https://stackoverflow.com/questions/5515869/string-length-in-bytes-in-javascript
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment