Use the LENGTH() function to get the length of the string and assign this number to a variable port v_length of type Integer.
Then use SUBSTR( original_string, 1, v_length - 1) to get everything except the last character from your input string.
If you have to explicitly check that this last character is a '0' digit (and in all other cases you need the complete string), then you can use this expression term:
IIF( SubStr( original_string, v_length, 1) = '0', SubStr( original_string, 1, v_length - 1), original_string)
This can be shortened to the following term:
SubStr( original_string, 1, v_length - IIF( SubStr( original_string, v_length, 1) = '0', 1, 0))
What does this expression mean?
The length of the string copy is either the length less one (if the last character is a '0') or the full length of the input string (if the last character is not a '0').
Above logic is working for me.Thanks alot Nico. It was really quick one !!