reverse()reverse()

此函数会反转输入字符串的顺序。Function reverses the order of the input string. 如果输入值不是 string 类型,则函数会强制将值转换为 string 类型。If the input value isn't of type string, then the function forcibly casts the value to type string.

语法Syntax

reverse(source)reverse(source)

参数Arguments

  • source:输入值。source : input value.

返回Returns

字符串值的逆序排序形式。The reverse order of a string value.

示例Examples

print str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
| extend rstr = reverse(str)
strstr rstrrstr
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ ZYXWVUTSRQPONMLKJIHGFEDCBAZYXWVUTSRQPONMLKJIHGFEDCBA
print ['int'] = 12345, ['double'] = 123.45, 
['datetime'] = datetime(2017-10-15 12:00), ['timespan'] = 3h
| project rint = reverse(['int']), rdouble = reverse(['double']), 
rdatetime = reverse(['datetime']), rtimespan = reverse(['timespan'])
rintrint rdoublerdouble rdatetimerdatetime rtimespanrtimespan
5432154321 54.32154.321 Z0000000.00:00:21T51-01-7102Z0000000.00:00:21T51-01-7102 00:00:3000:00:30