PDA

View Full Version : 求ls 中取字符串前几位形成新字符串的函数


天天888
12-09-06, 09:42 PM
有谁知道在ls中 取一个字符串前面指定位数字符形成新字符串的函数怎么写呀?

空空空
12-09-06, 10:57 PM
LS里有现成函数的:Left()
以下是Left()函数的帮助
Left[$] ( expr , n )
Elements
expr
Any numeric or String expression for Left; and any Variant or String expression for Left$. If expr is numeric, LotusScript converts it to a string before performing the extraction.
n
The number of characters to be returned.
Return value
Left returns a Variant of DataType 8 (a String), and Left$ returns a String.
If n is 0, the function returns the empty string (""). If n is greater than the length (in characters) of expr, the function returns the entire string.
Left(NULL) returns NULL. Left$(NULL) is an error.

天天888
12-09-06, 11:13 PM
原帖由 空空空 于 2006-9-12 10:57 PM 发表
LS里有现成函数的:Left()
以下是Left()函数的帮助
Left ( expr , n )
Elements
expr
Any numeric or String expression for Left; and any Variant or String expression for Left$. If expr is numeric, L ...


谢谢 已解决。不过我需要从第三个字符开始取,顺序取两个。我用了right(left(string,5),2),呵呵