Mercurial > vim
diff runtime/doc/eval.txt @ 6870:66ab6ec256d1 v7.4.755
patch 7.4.755
Problem: It is not easy to count the number of characters.
Solution: Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
Takata)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 25 Jun 2015 16:09:26 +0200 |
parents | 37828f7503c7 |
children | 29c328f69aaa |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1985,7 +1985,7 @@ split( {expr} [, {pat} [, {keepempty}]]) sqrt( {expr}) Float square root of {expr} str2float( {expr}) Float convert String to Float str2nr( {expr} [, {base}]) Number convert String to Number -strchars( {expr}) Number character length of the String {expr} +strchars( {expr} [, {skipcc}]) Number character length of the String {expr} strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr} strftime( {format}[, {time}]) String time in specified format stridx( {haystack}, {needle}[, {start}]) @@ -5913,15 +5913,11 @@ string({expr}) Return {expr} converted t *strlen()* strlen({expr}) The result is a Number, which is the length of the String {expr} in bytes. - If you want to count the number of multi-byte characters (not - counting composing characters) use something like this: > - - :let len = strlen(substitute(str, ".", "x", "g")) -< If the argument is a Number it is first converted to a String. For other types an error is given. - Also see |len()|, |strchars()|, |strdisplaywidth()| and - |strwidth()|. + If you want to count the number of multi-byte characters use + |strchars()|. + Also see |len()|, |strdisplaywidth()| and |strwidth()|. strpart({src}, {start}[, {len}]) *strpart()* The result is a String, which is part of {src}, starting from