Skip to main content
Solved

How to reverse character order in a string using FME?

  • March 28, 2019
  • 2 replies
  • 155 views

mwoj
Contributor
Forum|alt.badge.img+1
  • Contributor
  • 4 replies

I would like to reverse character order in the string e.g. from "Mariusz 123 #$" to "$# 321 zsuiraM". Do you know any FME function or transformer to perform this? I do not know Pyton.

Best answer by ebygomm

Use the string searcher to get every character as a list element, sort the list by startIndex in reverse order, then concatenate the list

 

reverse_string.fmw

 

Or if you did want to use a pythoncaller

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • Best Answer
  • March 28, 2019

Use the string searcher to get every character as a list element, sort the list by startIndex in reverse order, then concatenate the list

 

reverse_string.fmw

 

Or if you did want to use a pythoncaller


mwoj
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • 4 replies
  • March 28, 2019

@egomm Thank you.