Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading Strings with "\" in them #30

Open
Zapnologica opened this issue May 4, 2016 · 1 comment
Open

Reading Strings with "\" in them #30

Zapnologica opened this issue May 4, 2016 · 1 comment

Comments

@Zapnologica
Copy link

Zapnologica commented May 4, 2016

I have a db connection string in my config file:

Connection: "localhost\sqlexpress"

but when I debug. in code the variable is " localhostsqlexpress" (no "" )

and if put two "" then both of them appear in the variable?

is there a special way I need to read the string?

@ralsu091
Copy link

ralsu091 commented Jun 6, 2016

To read the string you need to escape "".
Your config file should look similar to this:
{ "Connection" : "localhost\\sqlexpress" }
The Debug breakpoint will display "localhost\\sqlexpress". However, try printing it to console. It should print "localhost\sqlexpress".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants