How do I remove all the special characters from a particular string ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do I remove all the special characters from a particular string ?

I'm trying to figure out how to remove special characters from a string can anyone help using c#.

22nd Apr 2020, 7:54 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
3 Answers
+ 2
I think you want to solve a code coach. This should help: https://www.sololearn.com/Discuss/2252852/why-my-code-is-not-passing-running-test-3-5
22nd Apr 2020, 7:56 PM
CeePlusPlus
CeePlusPlus - avatar
+ 1
Thank you for help ceeplusplus, but I'm using c# not python.
22nd Apr 2020, 7:58 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
+ 1
Read the string through a loop, if current one is, letter or number or space then store or print that, else ingore that.. Or in other way, if special char, do nothing else copy.. Or else use a regex which will replace with nothing "", or delete if it is not letter, or number or space...
22nd Apr 2020, 8:03 PM
Jayakrishna 🇮🇳