且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将字符串存储到array [] []并将其写入.txt文件?

更新时间:2023-11-07 16:32:22

使用string.Substring拆分字符串,然后将每个部分作为一行添加到文本文件中.您对2D数组的概念有些瑕疵(仅供参考).
Use string.Substring to split up the string, then append each part as a line in a text file. Your concept of a 2D array is a little flawed (just FYI).


使用split或substring方法将您的字符串分成几部分.然后使用File.WriteAllLines将它们写入文件.
Use split or substring method to break your string in parts. Then use File.WriteAllLines to write them into file.