split user:pass to user and pass in c# -
so have program user uploads list of user:pass in format , need user in it's own string , pass in it's own string.
example of tried
string account = listbox1.selectedindex.tostring(); char[] delimiterchars = { ':' }; account.split(delimiterchars);
i need front part of user string user , part string pass
use string.split:
var combined = "user:pass"; var split = combined.split(new[]{":"}); var user = split[0]; var password = split[1];
Comments
Post a Comment