David Knapčok David Knapčok - 1 year ago 77
C# Question

C# - Erasing all tabulators in string

I went into this problem.
I am reading a lot of informations from text file.

For better order in that text file, I have a dosens of tabulators in there.

When I read line and have it in string line, how do I erase all these tabulators before spliting it?

Thank you for your answer.

Answer Source
string text = File.ReadAllText(FilePath);

text = text.Replace("\r", "");//you can do it the same way if you mean \t

Just replace it with empty string. You can do it per line if you read it with File.ReadLines(FilePath)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download