I want to store and save back a single character in User.config (or App.config) file. Normal characters can be hold easily, but when it comes to special characters like \t
, \n
I cannot store them because VS2012 says it is not a character. I modify the User.config file with XML tags of \t
which is 	
it works! However, when it comes to save it again, it fails. When I assign \t
character like this in code Properties.Settings.Default.delim = '\t'
and call Save
method, program only stores \0
character. I cannot store XML equivalent string in code because it is a string, not a character and I'm trying to assign a string to a character.
Are there any thoughts on this?
You could store the decimal ASCII code for the character by converting to an
int
, and convert it back to achar
in your program.e.g.