Returns an array whose items are in reverse order of the given array.

Syntax

NewArray = SRP_Array("Reverse", Array, Delimiter)

Returns

The reversed array.

Parameters

ParameterDescription
ArrayThe dynamic array to be reversed. (REQUIRED)
DelimiterThe delimiter that separates items in Array. (OPTIONAL)

Remarks

This service quickly creates a new array whose items are the same items as the given array but in reverse order. If you pass in the following array...

"Apple":@FM:"Banana":@FM:"Orange":@FM:"Kiwi"

... you get this:

"Kiwi":@FM:"Orange":@FM:"Banana":@FM:"Apple"

The delimiter used in the return value will be the same used in the given array, which you can set using the Delimiter parameter. If Delimiter is omitted, @FM is assumed.

Examples

// Reverse @FM delimited array
Array = "Apple":@FM:"Banana":@FM:"Orange":@FM:"Kiwi"
Reversed = SRP_Array("Reverse", Array)

// Reverse comma delimited array
Array = "Apple,Banana,Orange,Kiwi"
Reversed = SRP_Array("Reverse", Array, ",")
  • No labels