#!/usr/bin/env js
var email = " hogehoge@example.com  \n";
var e = email.trim();
var atpos = e. indexOf('@');
var localpart = "", domainpart ="";
if (atpos >= 0 && atpos ==e.lastIndexOf('@')) {
    localpart = e.substring(0, atpos);
    domaipart = e.substr(atpos+1);
}
