Remove the last digits from a string

@lakshman

I also asked him to do this using regular expressions in my comment above. It seems he wants to do it without regex… I still wonder how we can achieve this easily without a regex

@Lahiru.Fernando

For this we have to use regular expression and it will give perfect result.

1 Like

@lakshman

That’s the same thing i mentioned too… It is hard to do it without regex. If we are to do it without regex, we might need to check for all the characters in the string to see whether its a numeric or not, and if its a numeric, we have to replace it with a blank value which is going to be seriously slow and inefficient.

Good it’s work
Thanks

1 Like

@Lahiru.Fernando @lakshman
I tried this it’s work but if i have for example AB3 1765 and the output :AB3?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.