Reputation: 119
I have a text file with many words separated by ;
. It looks like this:
eye;hand;mouth;arms;book
three;head;legs;home
I would like to go through this file and search for the symbol ;
and modify the file so that every word is transposed with line break.
Should I read the text file in a string first with,
string path = @"c:\temp\MyTest.txt";
string readText = File.ReadAllText(path);
Then check:
if readText.contains(";");
But I don't know what to do next
Upvotes: 2
Views: 818
Reputation: 2016
string readText = File.ReadAllText(path);
var result = readText.Replace(";", Environment.NewLine);
Upvotes: 6