This project is read-only.

String.prototype.equals(text, ignoreCase, trim)


Compare a string and indicate whether they are the same.


  • text: the string text to be compared.
    • Type: String
  • ignoreCase: A flag indicating whether ignoring the case when do the comparison.
    • Type: Boolean
  • trim: A flag indicating whether trim the string before the comparison.
    • Type: Boolean

Returned Value:

  • Value calculated


var text = "Rynn Wang";
document.write(text.equals("rynn wang"));
//Result: false;
document.write(text.equals("rynn wang", true));
//Result: true;
document.write(text.equals(" rynn wang", true));
//Result: false;
document.write(text.equals(" rynn wang", true, true));
//Result: true;

Last edited Aug 20, 2012 at 10:07 AM by rynnwang, version 3


No comments yet.