I have a constant string as shown below
const String GetSQL = @"select
id
from
emp
";
When I try to use the same in a method the value for the GetSQL is with the linebreaks
i.e. select \r\n id\r\n etc.
How can I get it in one line without those breaks
Thanks
Assuming you can’t modify the constant value itself (as in put in all on one line in the code), this will show you how to replace the line breaks:
Replace Line Breaks in a String C#