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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758184526, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/vim/script/vimscript/functions/strlen(70): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78