I am trying to put a list of delimiters in a web.config file, one of the delimiters is a carriage return - \r\n
.
The web.config entry looks like this -
<add key="Separators" value=" |,|;|\r\n"/>
I am trying to read in the list using a call like the following -
string[] MySeparators = ConfigurationManager.AppSettings ConfigSettings.PartNumberSeparators].Split('|');
The list is being read, but the carriage return ends up containing extra back slashes and looks like this - \\r\\n
Is there some way to prevent this from happening?
You could try using XML entities
and
. Provided that the .NET configuration system supports resolving these entities, then these should appear as \r\n
at runtime.
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