David Knapčok David Knapčok - 1 month ago 9
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
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)

Comments