Search notes:

vim script: strlen

strlen returns the number of bytes in a string. Use strchars to get the number of characters in a string.
"
"  ..\run_ strlen
"

redir > strlen.out

echo strlen("1234567890")
" 10

"
"    strlen returns the number of bytes in a string,
"    not the length of the string in characters:
"
echo strlen("äöü")
" 6

"
"    Use strchars to get the number 
"    characters:
"
echo strchars("äöü")
" 3

q
Github repository about-vim, path: /vimscript/functions/strlen.vim

See also

strchars vs strwidth vs strlen vs strdisplaywidth
Vim: built in functions
VIM script

Index