Display string containing '\ t'

I have a line like

string info = "C:\tempFile" , but when I show that it displays as C:empFile . I think the problem is with the tab delimiter (\ t), but I don't know how to fix it.

+5
source share
1 answer

This is simply because \ is a special character . You need to avoid this!

Two ways to solve it:

 string info = "C:\\tempFile.txt" ; // Means actually C:\tempFile.txt 

or

 string info = @"C:\tempFile.txt" ; // @ Means don't take care of every \ in this sequence 
+5
source

Source: https://habr.com/ru/post/1235654/


All Articles