Linefeed in C#
-
What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.
-
What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.
Have a look here: Environment.NewLine[^]
#region signature my articles #endregion
-
What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.
Try
Texg.Write(" + \\");
Texg.WriteLine("New Text String");or
Texg.Write(" + \\");
Texg.Write("\r\n");
Texg.Write("New Text String");
Try code model generation tools at BoneSoft.com.
-
What I need to do is append the string " + \" to the last line of a file and then go to the next line and write a string. It would seem something like this should work. Texg.Write(" + \\"); Texg.Write("\n"); Texg.Write("New Text String"); I get this as output where the @ sign is a rectangle: + \ @ A Text String + \@ A Text String + \@ A Text String What I want is: + \ A Text String + \ A Text String + \ A Text String This is easy in C++ and I am sure I missing something obvious.
try:
Texg.Write(@" + \"); Texg.Write(Environment.NewLine); Texg.Write(@"New Text String");