I am looking to create a formula that will reverse a string.
String - LocationA/LocationB
I want to reverse the text to display LocationB/LocationA
There is always a "/" between the two locations
Answer
local stringvar a_st := "";
local stringvar b_st := "";
local stringvar c_st := "";
if instr({table.street}, "/") > 0
then
(
a_st := split({table.street}, "/")[2];
b_st := split({table.street}, "/")[1];
if a_st < b_st
then c_st := a_st & "/" & b_st
else c_st := b_st & "/" & a_st;
)
else c_st := {table.street};
c_st
Edited by NCGOV - 11 Mar 2020 at 3:04am