Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying string that contains '\t'

Tags:

c#

I have a string like

string info = "C:\tempFile" but when I am displaying it's getting displayed like this C:empFile. I think its tab delimiter (\t) problem, but I don't know how to fix it.

like image 690
banker box Avatar asked Nov 11 '15 00:11

banker box


Video Answer


1 Answers

It's just because \ is a special character. You need to escape it !

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
like image 50
Perfect28 Avatar answered Oct 16 '22 23:10

Perfect28