文本文档有一行数据或多行数据,其中各列之间是用“~~”号分割的,想取出各列的数据用到split方法

 

string[] split = strTemp.Split(new string[1] { "~~" }, StringSplitOptions.None);

strTemp 是从文本读取出来的数据

读取文本数据

 

StreamReader sr = new StreamReader(new FileStream("文本名称", FileMode.Open, FileAccess.Read), System.Text.Encoding.Default);
            string strTemp = sr.ReadLine();

 

相关文章:

  • 2021-12-29
  • 2021-09-25
  • 2018-07-27
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2021-12-10
  • 2022-02-12
  • 2021-08-22
  • 2021-11-12
相关资源
相似解决方案