T-SQL Function to remove characters

Here is a T-SQL function I wrote that will remove all characters from a string except for the list of characters provided in the parameter. Here is an example of how it can be used to remove all character except digits. Result: 213921389