format - How to remove extra characters in a string in c#? -


i have string this:

"\"data source=.; initial catalog=dbname; user id=sa;password=1;integrated security=false\"" 

but need create string this:

"data source=.; initial catalog=dbname; user id=sa;password=1;integrated security=false" 

how can accomplish this?

this should work:

string myoriginalstring = "\"whatever\""; mysubstring = mystring.substring(1, mystring.length - 2); 

Comments