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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -