boukaka
asked on
Stringbuilder not working
I'm trying to use a stringbuilder to add lines together if the line is shorter than 305 characters. It reads the first line fine, reads the nextLine fine and captures those.
For some reason when I get to the string myString part it's blank.. How do I get my results into myString? Thanks!
policyLine = line;
nextLine = sr.ReadLine();
if(nextLine.Length < 305)
{
StringBuilder sb2 = new StringBuilder();
sb2.Append(policyLine);
sb2.Append(@"\");
sb2.Append(nextLine);
string myString = sb2.ToString();
}
For some reason when I get to the string myString part it's blank.. How do I get my results into myString? Thanks!
policyLine = line;
nextLine = sr.ReadLine();
if(nextLine.Length < 305)
{
StringBuilder sb2 = new StringBuilder();
sb2.Append(policyLine);
sb2.Append(@"\");
sb2.Append(nextLine);
string myString = sb2.ToString();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.