Thursday, 15 August 2013

How do I use string.StartsWith() when I only have some parts of the comparison string?

How do I use string.StartsWith() when I only have some parts of the
comparison string?

I'm working with the IRC-protocol, and I am trying to interpret the server
messages. If I for instance got the following string:
":USERNAME!~IP PRIVMSG #CHANNELNAME :MESSAGE"
How can I use string.StartsWith if I don't know the variables: USERNAME,
IP, CHANNELNAME or MESSAGE?
I would like to do something like this: (I'm aware that this doesn't work)
if(MessageString.StartsWith(":*!~* PRIVMSG #*"))

No comments:

Post a Comment