reverse()
Learn how to use the reverse() function to reverse the order of the input string.
Function reverses the order of the input string.
If the input value isn’t of type string, then the function forcibly casts the value to type string.
Syntax
reverse(value)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| value | string | ✔️ | input value. |
Returns
The reverse order of a string value.
Examples
print str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
| extend rstr = reverse(str)
Output
| str | rstr |
|---|---|
| ABCDEFGHIJKLMNOPQRSTUVWXYZ | ZYXWVUTSRQPONMLKJIHGFEDCBA |
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'])
Output
| rint | rdouble | rdatetime | rtimespan |
|---|---|---|---|
| 54321 | 54.321 | Z0000000.00:00:21T51-01-7102 | 00:00:30 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.