Skip to main content
Solved

How to Convert the Last Character to Lowercase if it's an Uppercase Letter in FME?

  • September 5, 2024
  • 2 replies
  • 83 views

1sean
Contributor
Forum|alt.badge.img+4

Hello everyone,

I'm looking for a way to check if the ending character of a string attribute is an uppercase letter, and if so, convert it to lowercase. For example:

  • Foo1K → Foo1k
  • BAR4 → BAR4 
  • BAZ → BAz

What's the best way to accomplish this in FME? Are there any specific transformers or approaches that I should use to achieve this result?

Best answer by dustin

You can do this in an AttributeCreator with the following string. This example assumes your attribute name is ‘att’.

@Substring(@Value(att),0,@Evaluate(@StringLength(@Value(att))-1))@LowerCase(@Substring(@Value(att),-1,1))

 

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

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • September 5, 2024

You can do this in an AttributeCreator with the following string. This example assumes your attribute name is ‘att’.

@Substring(@Value(att),0,@Evaluate(@StringLength(@Value(att))-1))@LowerCase(@Substring(@Value(att),-1,1))

 


1sean
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • September 5, 2024

Worked perfectly. Thanks @dustin