DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
JavaScript String Comparison
// Example use
// if (isSameString(tags, "_none_")) ...
function isSameString( s1, s2 )
{
alert( "s1: " + s1.toString() );
alert( "s2: " + s2.toString() );
if ( s1.toString() == s2.toString() )
{
return true;
}
else
{
return false;
}
}






Comments
Snippets Manager replied on Tue, 2009/09/29 - 5:59pm
return (s1.toString() == s2.toString());would do the same.