What is the best practice for inserting a newline character into a string in the .NET Compact Framework 2.0 SP2?
Does the Compact Framework not support Environment.NewLine? Ah well. You can just use "\r\n" - if you know you're on the compact framework, it's not like you're running on Mono where the default new line may be different :)
You could always create your own string property:
public static class PortableEnvironment
{
public static string NewLine
{
get
{
#if COMPACT_FRAMEWORK
return "\r\n";
#else
return Environment.NewLine;
#endif
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With