public bool Equals(PString s, bool ignoreCase) { byte *pStr1 = _address; byte *pStr2 = s._address; byte b1, b2; do { b1 = *pStr1++; b2 = *pStr2++; if (b1 != b2) { if (ignoreCase) { if (b1 >= 0x41 && b1 <= 0x5A) { if (b1 + 0x20 == b2) { continue; } } else if (b1 >= 0x61 && b1 <= 0x7A) { if (b1 - 0x20 == b2) { continue; } } } return(false); } } while (b1 != 0); return(true); }
public static bool Equals(PString s1, string s2, bool ignoreCase) { return(s1.Equals(s2, ignoreCase)); }