Method reverse()
- Method reverse
stringreverse(strings,int|voidstart,int|voidend)
arrayreverse(arraya,int|voidstart,int|voidend)
intreverse(inti,int|voidstart,int|voidend)- Description
Reverses a string, array or int.
- Parameter
s String to reverse.
- Parameter
a Array to reverse.
- Parameter
i Integer to reverse.
- Parameter
start Optional start index of the range to reverse. Default:
0(zero).- Parameter
end Optional end index of the range to reverse. Default for strings:
sizeof(s)-1. Default for arrays:sizeof(a)-1. Default for integers:Pike.get_runtime_info()->int_size - 1.This function reverses a string, char by char, an array, value by value or an int, bit by bit and returns the result. It's not destructive on the input value.
Reversing strings can be particularly useful for parsing difficult syntaxes which require scanning backwards.
- See also