The characters / and " are special characters in C #, so if you want to print them you need to use escape sequences. Enter \ before each \ and " as follows:
Code example:
static void Main(string[] args) { const string s = "! \\ \" # $ % \\ \" & ' \\ \\ ( % \\ \\ )"; foreach (char c in s) { Console.WriteLine(c); Console.Read(); } }
In this console example, you will get each character every time you press the enter key. By the way, added spaces are important for printing each character. If you remove spaces, characters will be printed in pairs.
Hope this helps.
source share