Funtions

Hi,

I have a value like APPIAN123, need to display the output as APPIAN321

Guide me

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Ok, so this is pretty straightforward. let's break it down into a smaller set of problems:

    1. we extract the numbers from the string - we can use fn!right() to do this since we know the number part is always the same (3)
    2. we can extract the text from the string - we can use fn!length() to establish how long the whole string is and then subtract 3, since we know the numbers will always be 3 long, and so use fn!left() to extract the characters
    3. we need to reverse the numbers - fn!reverse() will only work on an array so you can create an array of the numbers from the extract taken above and then reverse them
    4. you can then join the reversed numbers array so that it is now one string
    5. finally you can concatenate the two strings - the extracted characters part, and the reversed numbers string

    hopefully that'll give you a direction to solve this for yourself