// s = mail address or gmail handle sS gmailGetHandle(S s) { if (empty(s)) ret s; int i = s.indexOf('@'); if (i < 0) ret s.toLowerCase(); S a = s.substring(0, i), b = s.substring(i+1); if (eqicOneOf(b, "gmail.com", "googlemail.com")) ret a.toLowerCase(); fail("Not a gmail address: " + s); }