我有一个文本文件,其中许多单词用;
分隔。看起来像这样:
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);
关于c# - C#分隔文本文件中的单词,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36377627/