jeudi 6 août 2020

ASSIST WITH RUBY CODE TO GET "user", "domain" and "domain.com" from email string user@domain.com

please i need help with sumthing like substring of php for ruby that can make me get "user" "domain" and "domain.com" in this output email "user@domain.com"

e.g john@dortmund.com

let say i have %3% in my line of code to call user the result will be = "john"

let say i have %2% in my line of code to call domainname the result will be = "dortmund"

let say i have %1% in my line of code to call domain.com the result will be = "dortmund.com"

i have been cracking my head but couldn't get it.

thank you.

Aucun commentaire:

Enregistrer un commentaire