17/23

Reverse a String

Easy

Given an input string, return the string in reverse order without using Appian's reverse() function.

Example:

Input:
"HELLO"

Output:
"OLLEH"


Restrictions

Solve this without using reverse().

ri! Rule Inputs

ri!textText
"Hello"

Example 1 — Case 1

Input: ri!text
"Hello"
Output:
"olleH"

Example 2 — Case 2

Input: ri!text
"AppianVerse"
Output:
esreVnaippA

Example 3 — Case 3

Input: ri!text
"madam"
Output:
madam

Example 4 — Case 4

Input: ri!text
"1234578"
Output:
"8754321"

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter