Is there a simple way to check if a string in JavaScript matches a certain thing for example:
Lets say the you wanted to check for the first word which had:
/admin this is a message
Then using JS to look for /admin so that I can direct the message in my chat window??
One way would be to use indexOf() to see if /admin is at pos 0.
If n = 0, then you know /admin was at the start of the message.
If the string does not exist in the message, n would equal -1.