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