Check first x number of letters of a string
<p>Is there a simple way to check if a string in JavaScript matches a certain thing for example:</p>

<p>Lets say the you wanted to check for the first word which had:</p>

<p><code>/admin this is a message</code></p>

<p>Then using JS to look for <code>/admin</code> so that I can direct the message in my chat window??</p>
