I am looking to create a function that will accept a string and only return the alpha/numeric values, except for dashes all special characters should get stripped out.
P.S. If possible, would prefer to have the 2nd variable of the function (the one holding the dash) capable of managing more than one character as an exception, so I can send "_,-,' ') and all 3 of them would be considered valid characters, not getting stripped out.
beyond that, there is a lot of generic "find and replace" code floating around. But this seems specific enough for you to write your own.
It's simple enough....just loop through the string and dump anything you don't want. Generally done with an In and out string, the latter of which you build up as you read the "in" string.
See: https://stackoverflow.com/