Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8316679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:24:54+00:00 2026-06-08T21:24:54+00:00

I am using jsp for a web based project. i want to remove all

  • 0

I am using jsp for a web based project. i want to remove all the characters after ‘@’ including ‘@’.

suppose I got “stackoverflow@stack.com” as input from a user. I have to remove the characters after @ and also ‘@’ i.e.

o/p is stackoverflow

I think one way is using java array OR by regex.
Please suggest me the better way of solving this problem. Are there any other ways of solving this??

How can I do it using JSP? I can not use javascript for this only jsp.

Thank You.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:24:55+00:00Added an answer on June 8, 2026 at 9:24 pm

    Why not use the Java String?

    One way:

    String output = input;
    int at = input.indexOf('@');
    if (at != -1) {
        output = input.substring(0, at); 
    }
    

    (it could be optimised into less lines, but this is the clearest way to write it).

    Or

    String output = input.split("@", 2)[0];
    // I prefer the first way, this is a bit more wasteful, but that is probably
    // just a personal hang up from the days of embedded C ;-)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a web project using jsp, I have following requirement Upload a file (say
i'm helping develop a java jsp jstl based web service and all dynamic objects
Using Eclipse Helios, I tried to start a JSF based project. After having created
My web application is written using jsp/javascripts. Backend Java. Have managed to implement the
I'm working on a web application using JSP/Servlets, etc. And I have a lot
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
Using IE 7, JDK 1.6 and Sun Web server 7. Inside the jsp form,
I have a web application built using jsp/servlets.The web application session is set to
I have some questions about using Hibernate in JSP web application. What should be
I'm using a jsp file as a model from a Controller and I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.