Javascript String compareTo(otherString)
String.prototype.compareTo = function(otherString) { if (this < otherString) return -1; if (this > otherString) return 1; return 0;/*from w w w . ja v a2 s .c o m*/ };