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
  • 57 views

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

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))

 

View original
Did this help you find an answer to your question?

2 replies

dustin
Influencer
Forum|alt.badge.img+30
  • 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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings