I want to slice that string
conStr = "server='MyServer';DataBase='MySQL';username='myAdmin';password='myPass';"
indexOf(;)
and parse the values into an object{string server, string DataBase,etc}
how should i do that?
答案 0 :(得分:2)
You can use Split function to split your string into tokens
string phrase = "server='MyServer';DataBase='MySQL';username='myAdmin';password='myPass';";
string[] words = phrase.Split(';');