我有一个文本文件,其中许多单词用分隔;
。看起来像这样:
eye;hand;mouth;arms;book
three;head;legs;home
我想浏览此文件并搜索符号;
并修改文件,以便每个单词都换行。
我是否应该首先使用字符串读取文本文件,
string path = @"c:\temp\MyTest.txt";
string readText = File.ReadAllText(path);
然后检查:
if readText.contains(";");
但是我不知道下一步该怎么做
string readText = File.ReadAllText(path);
var result = readText.Replace(";", Environment.NewLine);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句