|
查函数 function
substr(s,n1,n2)
Domain s: strings
Domain n1: integers 1 to 244 and -1 to -244
Domain n2: integers 1 to 244 and -1 to -244
Range: strings
Description: returns the substring of s, starting at column n1, for a length of n2. If n1 < 0, n1 is
interpreted as distance from the end of the string; if n2 = . (missing), the remaining
portion of the string is returned.
substr("abcdef",2,3) = "bcd"
substr("abcdef",-3,2) = "de"
substr("abcdef",2,.) = "bcdef"
substr("abcdef",-3,.) = "def"
substr("abcdef",2,0) = ""
substr("abcdef",15,2) = ""
|