diff runtime/doc/eval.txt @ 15:631143ac4a01 v7.0007

updated for version 7.0007
author vimboss
date Sat, 10 Jul 2004 09:47:34 +0000
parents 946da5994c01
children 293621502c4d
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -928,6 +928,8 @@ system( {expr})			String	output of shell
 tempname()			String	name for a temporary file
 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}
 type( {name})			Number	type of variable {name}
 virtcol( {expr})		Number	screen column of cursor or mark
 visualmode( [expr])		String	last visual mode used
@@ -2608,6 +2610,20 @@ toupper({expr})						*toupper()*
 		characters turned into uppercase (just like applying |gU| to
 		the string).
 
+tr({src}, {fromstr}, {tostr})				*tr()*
+		The result is a copy of the {src} string with all characters
+		which appear in {fromstr} replaced by the character in that
+		position in the {tostr} string.  Thus the first character in
+		{fromstr} is translated into the first character in {tostr}
+		and so on.  Exactly like the unix "tr" command.
+		This code also deals with multibyte characters properly.
+
+		Examples: >
+			echo tr("hello there", "ht", "HT")
+<		returns "Hello THere" >
+			echo tr("<blob>", "<>", "{}")
+<		returns "{blob}"
+
 type({expr})						*type()*
 		The result is a Number:
 			0 if {expr} has the type Number