Quantcast
Channel: String length in bytes in JavaScript - Stack Overflow
Viewing all articles
Browse latest Browse all 19

Answer by Iván Pérez for String length in bytes in JavaScript

$
0
0

Another very simple approach using Buffer (only for NodeJS):

Buffer.byteLength(string, 'utf8')Buffer.from(string).length

Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>