Skip to content

lenb

Number of bytes in a string.

v = lenb(text)

Like len but returns the byte length, with multi-byte (e.g. CJK) characters counted by their UTF-8 byte width.

lenb('hello') % 5
  • len — Number of characters in a string.
  • leftb — First N bytes of a string.
  • rightb — Last N bytes of a string.
  • midb — Substring by byte position and length.