Mercurial > vim
comparison runtime/doc/eval.txt @ 2339:01e4b4d37842 vim73
Added strdisplaywidth() function.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 18 Jul 2010 15:45:49 +0200 |
parents | da6ec32d8d8f |
children | 0703d2fd5749 |
comparison
equal
deleted
inserted
replaced
2338:da6ec32d8d8f | 2339:01e4b4d37842 |
---|---|
1908 List make |List| from {pat} separated {expr} | 1908 List make |List| from {pat} separated {expr} |
1909 sqrt( {expr} Float squar root of {expr} | 1909 sqrt( {expr} Float squar root of {expr} |
1910 str2float( {expr}) Float convert String to Float | 1910 str2float( {expr}) Float convert String to Float |
1911 str2nr( {expr} [, {base}]) Number convert String to Number | 1911 str2nr( {expr} [, {base}]) Number convert String to Number |
1912 strchars( {expr}) Number character length of the String {expr} | 1912 strchars( {expr}) Number character length of the String {expr} |
1913 strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr} | |
1913 strftime( {format}[, {time}]) String time in specified format | 1914 strftime( {format}[, {time}]) String time in specified format |
1914 stridx( {haystack}, {needle}[, {start}]) | 1915 stridx( {haystack}, {needle}[, {start}]) |
1915 Number index of {needle} in {haystack} | 1916 Number index of {needle} in {haystack} |
1916 string( {expr}) String String representation of {expr} value | 1917 string( {expr}) String String representation of {expr} value |
1917 strlen( {expr}) Number length of the String {expr} | 1918 strlen( {expr}) Number length of the String {expr} |
5366 | 5367 |
5367 strchars({expr}) *strchars()* | 5368 strchars({expr}) *strchars()* |
5368 The result is a Number, which is the number of characters | 5369 The result is a Number, which is the number of characters |
5369 String {expr} occupies. Composing characters are counted | 5370 String {expr} occupies. Composing characters are counted |
5370 separately. | 5371 separately. |
5371 Also see |strlen()| and |strwidth()|. | 5372 Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. |
5373 | |
5374 strdisplaywidth({expr}[, {col}]) *strdisplaywidth()* | |
5375 The result is a Number, which is the number of display cells | |
5376 String {expr} occupies on the screen. | |
5377 When {col} is omitted zero is used. Otherwise it is the | |
5378 screen column where to start. This matters for Tab | |
5379 characters. | |
5380 When {expr} contains characters with East Asian Width Class | |
5381 Ambiguous, this function's return value depends on 'ambiwidth'. | |
5382 Also see |strlen()|, |strwidth()| and |strchars()|. | |
5372 | 5383 |
5373 strftime({format} [, {time}]) *strftime()* | 5384 strftime({format} [, {time}]) *strftime()* |
5374 The result is a String, which is a formatted date and time, as | 5385 The result is a String, which is a formatted date and time, as |
5375 specified by the {format} string. The given {time} is used, | 5386 specified by the {format} string. The given {time} is used, |
5376 or the current time if no time is given. The accepted | 5387 or the current time if no time is given. The accepted |
5430 | 5441 |
5431 :let len = strlen(substitute(str, ".", "x", "g")) | 5442 :let len = strlen(substitute(str, ".", "x", "g")) |
5432 < | 5443 < |
5433 If the argument is a Number it is first converted to a String. | 5444 If the argument is a Number it is first converted to a String. |
5434 For other types an error is given. | 5445 For other types an error is given. |
5435 Also see |len()|, |strchars()| and |strwidth()|. | 5446 Also see |len()|, |strchars()|, |strdisplaywidth()| and |
5447 |strwidth()|. | |
5436 | 5448 |
5437 strpart({src}, {start}[, {len}]) *strpart()* | 5449 strpart({src}, {start}[, {len}]) *strpart()* |
5438 The result is a String, which is part of {src}, starting from | 5450 The result is a String, which is part of {src}, starting from |
5439 byte {start}, with the byte length {len}. | 5451 byte {start}, with the byte length {len}. |
5440 When non-existing bytes are included, this doesn't result in | 5452 When non-existing bytes are included, this doesn't result in |
5476 starting a new line. | 5488 starting a new line. |
5477 | 5489 |
5478 strwidth({expr}) *strwidth()* | 5490 strwidth({expr}) *strwidth()* |
5479 The result is a Number, which is the number of display cells | 5491 The result is a Number, which is the number of display cells |
5480 String {expr} occupies. A Tab character is counted as one | 5492 String {expr} occupies. A Tab character is counted as one |
5481 cell (on the screen it depends on the position). | 5493 cell, alternatively use |strdisplaywidth()|. |
5482 When {expr} contains characters with East Asian Width Class | 5494 When {expr} contains characters with East Asian Width Class |
5483 Ambiguous, this function's return value depends on 'ambiwidth'. | 5495 Ambiguous, this function's return value depends on 'ambiwidth'. |
5484 Also see |strlen()| and |strchars()|. | 5496 Also see |strlen()|, |strdisplaywidth()| and |strchars()|. |
5485 | 5497 |
5486 submatch({nr}) *submatch()* | 5498 submatch({nr}) *submatch()* |
5487 Only for an expression in a |:substitute| command. Returns | 5499 Only for an expression in a |:substitute| command. Returns |
5488 the {nr}'th submatch of the matched text. When {nr} is 0 | 5500 the {nr}'th submatch of the matched text. When {nr} is 0 |
5489 the whole matched text is returned. | 5501 the whole matched text is returned. |