我尝试了很多可能的解决方案来解决这个问题,但它似乎没有工作。我的问题如下:我有一个包含多行的txt文件。每一行都有类似:如何从txt文件夹中剪切多个字符串#
xxxxx yyyyyy
xxxxx yyyyyy
xxxxx yyyyyy
xxxxx yyyyyy
...
我想在字符串中xxxxx
的一个阵列和另一个阵列的yyyyy
存储,对txt文件的每一行,像
string[] x;
string[] y;
string[1] x = xxxxx; // the x from the first line of the txt
string[2] x = xxxxx; // the x from the second line of the txt
string[3] x = xxxxx; // the x from the third line of the txt
.. 。
and string[] y
;
...但我不知道如何...
我非常感激,如果有人告诉我如何使循环对于这个问题,我有。
问题didnt格式化好的......在file.txt的,每一行都有XXXXX YYYYY文本。 – thecner
那么你有两个(只有两个)类别的字符串,你想分成两个不同的数组?或者你需要检查类别数量(重复)? – pijemcolu
只有2个类别,xxxxx和yyyyy – thecner