I have a String in Java called Kiran<kiran@gmail.com>. I want to get String just kiran@gmail.com by removing other content.
String s1= kiran<kiran@gmail.com>
Output should be kiran@gmail.com
Please help me out in solving this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are trying to parse email addresses, I’d recommend to use the InternetAddress class. It is part of Java EE (if you are using Java SE you need to add the javax.mail dependency).
That class is able to parse an String containing an email address like yours.
I think this way: