suve

awful: function: str-bytes

Available since rev.33 (v.0.4.2).

Declaration

int :str-bytes ( string $STR )

Summary

Returns length of given string, in bytes. For ASCII strings, this is identical to :str-len.

Example

# :str-bytes example
:set &UTF u''
:readln &UTF

:writeln s'$UTF = ' $UTF
:writeln s'Codepoints: ' :str-len $UTF
:writeln s'Bytes: ' :str-bytes $UTF

wikipage modified on 2014/0601/2317