with the option to keep spaces, dashes, and underscores
instructions
Create a function that takes a string, removes all "special" characters (e.g. ! @ # $ % ^ & \ *) and returns
the new string.
The only non-alphanumeric characters allowed are dashes -, underscores _ and spaces.
Use the 3 tests below. Write the function in whatever language most comfortable. Bonus points for PHP. It
shouldn't take longer than 25 minutes. Data is unformatted to mimic raw api data and translating issues into
workable projects.
It's simple code but not seeing the strings in the way you're expecting to and seeing a lot of special
characters that you know you will have to remove will cause issues for those that are way too junior for our
role.
Enter Your String Here
Please enter a string in the text area.
Tests
Input 1:
S!c@i#e$n^c&e w\i\th!out $religio$n i!s la\me,_rel\i\g\ion-with*out science is$ bli^nd Output 1:
Science without religion is lame_religion-without science is blind