jQuery Check if String Contains Word
<p>I'm working on an application where you can click on user names to add them to the reply list.
If the username is already added, it doesn't add their username again.
The problem I'm having is that if the user @assassin is added, and I try to add the user @ass, it finds @ass-assin and thinks that @ass is already added.
Here's my code:</p>

<pre><code>$('#mentions a.mention_user').live('click', function(e){if($('textarea#message').val().toLowerCase().search('@'+$(this).text().toLowerCase()) &lt; 0){
        $('textarea#message').val('@'+$(this).text()+' '+$('textarea#message').val());
    }
    e.preventDefault();
});
</code></pre>

<p>Thanks in advance!</p>

<p>EDIT: The text it'll be matching the usernames against will look similar to this: @user @joe @adam this is a message @someone</p>
