Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1003576 // gmailGetHandle

JavaX fragment (include)

// 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);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003576
Snippet name: gmailGetHandle
Eternal ID of this version: #1003576/3
Text MD5: a2c38546ed7f84ec681507e9ae843dc5
Author: stefan
Category: javax / gmail bot
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-03-01 19:19:23
Source code size: 316 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 568 / 631
Version history: 2 change(s)
Referenced in: [show references]