I want to add each row to a string. As with this format, string = "dependent" line 1 line 2 line 3 line 4 line 5 / dependent ""
In short, I want to see it on each line and "dependent" "/ Depends" to finish in a string, how do I do this?
while (nextLine! = "& Lt; / depend>") {fullString = line + currentline;} & lt; Dependent & gt; Line1 line2 line3 line4 line5 line6 & lt; / Dependent
last BufferedReader br = new buffer reader (new file reader "Path to your file")); The final stringbilder SB = New stringbilder (); String next row = br.readline (); // Leave First; depends on; Gt; While (next! = Null & amp;;; next line.edge ("& lt; / dependent;")) // file is not the end, and the closing tag {sb.append (nextLine) is not; NextLine = br.readline ();} final string full string = sb .toString ();
Comments
Post a Comment