diff --git a/email.js b/email.js new file mode 100644 index 0000000..c524d36 --- /dev/null +++ b/email.js @@ -0,0 +1,12 @@ +#!/usr/bin/env js +var email = " hogehoge@example.com \n"; +print(email) +email = email.trim() +print(email) +var localpart = "", domainpart =""; +var atpos = e.indexOf('@'); +if (atpos >= 0 && atpos == e.lastIndexOf('@')) { + localpart = e.substring(0, atpos); + domainpart = e.substr(atpos+1); +} +print(`local=${localpalt}, dom=${domainpart}`); diff --git a/hello.js b/hello.js new file mode 100755 index 0000000..c799ca1 --- /dev/null +++ b/hello.js @@ -0,0 +1,6 @@ +#!/usr/bin/env js +s = "Hello, world!"; +for (var i=0; i