Hi Vellore,
It's not easier and performatic to just doesn't select the class identification, but only the value?
In that way you won't have it to split/remove...
If this doesn't answer you, please share your SQL for better understanding.
Kind regards, Fernando Da Rós