|
返回值类型
|
名称
|
描述
|
|
Int
|
length(string A)
|
返回字符串长度
|
|
String
|
reverse(string A)
|
反转字符串
|
|
String
|
concat(string A, string B…)
|
合并字符串,例如concat(‘foo’, ‘bar’)=’foobar’。注意这一函数可以接受任意个数的参数
|
|
String
|
substr(string A, int start) substring(string A, int start)
|
返回子串,例如substr(‘foobar’, 4)=’bar’
|
|
String
|
substr(string A, int start, int len) substring(string A, int start, int len)
|
返回限定长度的子串,例如substr(‘foobar’, 4, 1)=’b’
|
|
String
|
upper(string A) ucase(string A)
|
转换为大写
|
|
String
|
lower(string A) lcase(string A)
|
转换为小写
|
|
String
|
trim(string A)
|
|
|
String
|
ltrim(string A)
|
|
|
String
|
rtrim(string A)
|
|
|
String
|
regexp_replace(string A, string B, string C)
|
Returns the string resulting from replacing all substrings in B that match the Java regular expression syntax(See Java regular expressions syntax) with C e.g. regexp_replace(“foobar”, “oo|ar”, “”) returns ‘fb.’ Note that some care is necessary in using predefined
character classes: using ‘\s’ as the second argument will match the letter s; ‘\\s’ is necessary to match whitespace, etc.
|
|
String
|
regexp_extract(string subject, string pattern, int intex)
|
返回使用正则表达式提取的子字串。例如,regexp_extract(‘foothebar’, ‘foo(.*?)(bar)’, 2)=’bar’。注意使用特殊字符的规则:使用’\s’代表的是字符’s';空白字符需要使用’\\s’,以此类推。
|
|
String
|
parse_url(string urlString, string partToExtract)
|
解析URL字符串,partToExtract的可选项有:HOST, PATH, QUERY, REF, PROTOCOL, FILE, AUTHORITY, USERINFO。
|
|
例如,
|
|
parse_url(‘;, ‘HOST’)=’’
|
|
parse_url(‘;, ‘PATH’)=’/path/p1.php’
|
|
parse_url(‘;, ‘QUERY’)=’query=1′,可以指定key来返回特定参数,key的格式是QUERY:,例如QUERY:k1
|
|
parse_url(‘;field=2′,’QUERY’,'query’)=’1′可以用来取出外部渲染参数key对应的value值
|
|
parse_url(‘;field=2′,’QUERY’,'field’)=’2′
|
|
parse_url(‘;, ‘REF’)=’Ref’
|
|
parse_url(‘;, ‘PROTOCOL’)=’http’
|
|
String
|
get_json_object(string json_string, string path)
|
解析json字符串。若源json字符串非法则返回NULL。path参数支持JSONPath的一个子集,包括以下标记:
|
|
$: Root object
|
|
[]: Subscript operator for array
|
|
&: Wildcard for []
|
|
.: Child operator
|
|
String
|
space(int n)
|
返回一个包含n个空格的字符串
|
|
String
|
repeat(string str, int n)
|
重复str字符串n遍
|
|
String
|
ascii(string str)
|
返回str中第一个字符的ascii码
|
|
String
|
lpad(string str, int len, string pad)
|
左端补齐str到长度为len。补齐的字符串由pad指定。
|
|
String
|
rpad(string str, int len, string pad)
|
右端补齐str到长度为len。补齐的字符串由pad指定。
|
|
Array
|
split(string str, string pat)
|
返回使用pat作为正则表达式分割str字符串的列表。例如,split(‘foobar’,
‘o’)[2] = ‘bar’。?不是很明白这个结果
|
|
Int
|
find_in_set(string str, string strList)
|
Returns the first occurance of str in strList where strList is a comma-delimited string. Returns null if either argument is null. Returns 0 if the first argument contains any commas. e.g. find_in_set(‘ab’, ‘abc,b,ab,c,def’) returns 3
|