aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-15 10:26:21 +0200
committerGitHub <noreply@github.com>2018-08-15 10:26:21 +0200
commitbdcd3c31c6b264e5925eee28d6386fb72d14921b (patch)
treebf9e1345f1e446a06ccdf5f6b76a1b85b1fdb23c /runtime
parent26506f14bc653a555b32e553bf458efc6402ed0b (diff)
parent538ace9aae0c3b9e7e1ef242e00c53df6ec2e7da (diff)
downloadrneovim-bdcd3c31c6b264e5925eee28d6386fb72d14921b.tar.gz
rneovim-bdcd3c31c6b264e5925eee28d6386fb72d14921b.tar.bz2
rneovim-bdcd3c31c6b264e5925eee28d6386fb72d14921b.zip
Merge #8852 from janlazo/vim-8.1.0161
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 4c0ee6cc66..cfc3b70443 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2336,6 +2336,7 @@ tolower({expr}) String the String {expr} switched to lowercase
toupper({expr}) String the String {expr} switched to uppercase
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
+trim({text}[, {mask}]) String trim characters in {mask} from {text}
trunc({expr}) Float truncate Float {expr}
type({name}) Number type of variable {name}
undofile({name}) String undo file name for {name}
@@ -7962,6 +7963,22 @@ tr({src}, {fromstr}, {tostr}) *tr()*
echo tr("<blob>", "<>", "{}")
< returns "{blob}"
+trim({text}[, {mask}]) *trim()*
+ Return {text} as a String where any character in {mask} is
+ removed from the beginning and end of {text}.
+ If {mask} is not given, {mask} is all characters up to 0x20,
+ which includes Tab, space, NL and CR, plus the non-breaking
+ space character 0xa0.
+ This code deals with multibyte characters properly.
+
+ Examples: >
+ echo trim(" \r\t\t\r RESERVE \t \t\n\x0B\x0B")."_TAIL"
+< returns "RESERVE_TAIL" >
+ echo trim("needrmvRESERVEnnneeedddrrmmmmvv", "ednmrv")
+< returns "RESERVE" >
+ echo trim("rm<blob1><blob2><any_chars>rrmm<blob1><blob2><blob2>", "rm<blob1><blob2>")
+< returns "any_chas"
+
trunc({expr}) *trunc()*
Return the largest integral value with magnitude less than or
equal to {expr} as a |Float| (truncate towards zero).