You can use the StringReplacer, use the regular expression [a-zA-Z]$ to remove the last character if it is in the mentioned range and replace with nothing. Or use [a-z]$ and case sensitive No.
SubStringExtractor to extract the 4th character to new attribute.
AttributeClassifier to test that attribute to see if its Alphabetic.
Records that pass go through another SubStringExtractor and extract values 0 to 2 or 0 to -2 from the original attribute to a new attribute or overwrite the old one.
Or do some Regex magic...no doubt about to appear below this post...
SubStringExtractor to extract the 4th character to new attribute.
AttributeClassifier to test that attribute to see if its Alphabetic.
Records that pass go through another SubStringExtractor and extract values 0 to 2 or 0 to -2 from the original attribute to a new attribute or overwrite the old one.
Or do some Regex magic...no doubt about to appear below this post...
or above this post... I was too slow!
You can use the StringReplacer, use the regular expression [a-zA-Z]$ to remove the last character if it is in the mentioned range and replace with nothing. Or use [a-z]$ and case sensitive No.
Thanks. not sure what I am doing wrong,
I didn't get the results I expected.
Here you go if you want to try it with a couple of standard Transformers.
stripofflastchar.fmw