How to find last non-numeric character in a string such as "10jnklgm51". In order to find 'm' in the example what is the best simple way?
Asked
Active
Viewed 3,434 times
1 Answers
7
The last non-numeric character is the first non-numeric character in the reverse string. So, something like this:
select substring(reverse(str),
patindex('%[^0-9]%', reverse(str)),
1)

Gordon Linoff
- 1,242,037
- 58
- 646
- 786