Try using .Trim before appending it to the text file. .Trim() method is used to remove leading and trailing whitespace (spaces, tabs, etc.) from a string.
I have this string
which can be duplicated thats why in the end i have Environment.NewLine()
Header +Environment.NewLine()+Body+ Environment.NewLine()+footer+ Environment.NewLine();
but when i append to a file its auto add newline “CRLF” trying to skip it with keeping the white spaces in the Footer line
Hi,
i dont append to file directly first i collect the string =+ Header +Environment.NewLine()+Body+ Environment.NewLine()+footer+ Environment.NewLine();