You can do something like this (as long as your not .net 2.0):
public static class StringExt { public static String FixNewLines(this String str) { return str.Replace(@'\n',Environment.NewLine); } }
And then:
string someMsg = GlobalStrings.MsgBoxJustTest + someDetails; MessageBox.Show(someMsg.FixNewLines());
However, this will affect ALL lines in your application (namespace area)
This is a dirty fix, but it is a quick fix.
Personally, I just correct my logic to the end, and do not do something like the above.
Theofanis pantelides
source share