LoginSignup
0
0

【JavaScript】文字列のバイト数を取得する方法

Posted at

以下のように記述することで文字列のバイト数を取得できます。

function getStringByteCount(str: string) {
  return new Blob([str]).size
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0