is there any way to join back the previous (looped line) in StringReader? because i would like to loop over a text to find a specific words, then join back with the previous line after found.
here what's i done so far:
using (StringReader reader = new StringReader(currentText))
{
string line;
var prevline = "";
var newline = "";
var des= "";
while ((line = reader.ReadLine()) != null)
{
string[] splittedTxt = line.Split(new[] { " " },
StringSplitOptions.RemoveEmptyEntries);
if (line.Contains("Fee"))
{
for (int i = 0; i < splittedTxt.Length; i++)
{
des += splittedTxt[i] + " ";
newline = prevline +" " + des;
}
}
}
}