认为我有一些大字符串 在以下结构中:
parameter1|parameter2|parameter3|parameter4+" "
* 如果参数是某些字符的序列,其长度一般不为人知。
现在想想我的大字符串 持有4行的数据,例如:
parameter1|parameter2|parameter3|parameter4+" "
parameter1|parameter2|parameter3|parameter4+" "
parameter1|parameter2|parameter3|parameter4+" "
parameter1|parameter2|parameter3|parameter4+" "
How can I read the first line and then read the second line and so on?
I know that I can use Substring
method to get the first line every time easily, however
how can I use Substring
(or other methods) to get the next 3 lines of the big string, in order to extract the first line again (which represent the second line of the original big string in practice).
I know that all I need is the index of the last " " (line 4) and I already have the index of current line " ".
Should I just use lastIndexOf(" ")
?
If you have any other ideas or even criticism about this way of working, I ll be more than glad to hear about.
谢谢:)