Does anyone know how to remove ordinal indicators (º and/or ª) from a text string?

I found code to remove diacritics (accents on letters), but these are not included. I’ve also tried a simple character replace, but when I paste these characters in the x++ code, it adds an underline to them and doesn’t replace them when executed. I’ve also tried using alt+0186 and alt+0170 to create them, but same thing with the underline.