I need to create an easy way to split up some strings into formatted strings, for example, i have this string
":[email protected] PRIVMSG #channel :test message"
and i need to split that into:
string nickname = "JStoker"
string ident = "stoker"
string host = "jcs.me.uk"
string channel = "#channel"
string message = "test message"
and i need to do that in a way that if say i get a string like
":irc.testnet.com PRIVMSG #channel :test message"
for instance, i would need something like
string nickname = "irc.testnet.com"
string ident = ""
string host = ""
string channel = "#channel"
string message = "test message"
through the same thing, without throwing an error... and the string im using changes all the time, if your familiar this is raw IRC data.. i just need to know how to parse the data efficiantly.
possibly could be done through Regex but im not sure. please help! ~ code examples please