#!/usr/bin/env js
var email = " hogehoge@example.com  \n";
print(email);
email = email.trim();
print(email);

var localpart = "", domainpart ="";
 var atpos = email.indexOf('@');
  if (atpos >= 0 && atpos == e.lastIndexOf('@')) {
    localpart  = email.substring(0, atpos);
    domainpart =  email.substr(atpos+1);
  }

print('local=${localpart},dom=${dominpart}');
