Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i have one jsp page. inside this,
String s=req.getParameter("raja");......
now we want to remove duplicate characters and o/p will be
like "rj".... what is the logic?

Answer Posted / sajin dhas

Please check below jsp code.

<% String message= "saajin";
for (int i = 0; i < message.length(); i++){
for (int j = i + 1; j < message.length(); j++){
if (message.charAt(i) == message.charAt(j)){
message = message.substring(0,(j - 1)) +
message.substring(j + 1, message.length());
out.println("Servlet Communicate Messge\n"+message);
}
}
}
%>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we avoid direct access of jsp pages from client browser?

1135


Is the session object always created on the jsp page, is it possible to disable its creation?

895


Why jsp and servlets are used?

929


What are the implicit, internal objects and methods on the jsp page?

870


Which package does jsp api consist of?

989


Why use of scripting elements in jsp is discouraged?

930


How can the applets be displayed in the jsp? Explain with an example.

923


What is scriptlet in jsp?

964


How do I create a dynamic web project?

887


What is a declaration statement?

936


What is the purpose of ?

953


What is jsp declaration?

917


What is the purpose of jsp?

982


How to print java variable in jsp?

923


Why does jcomponent have add() and remove() methods but the component does not?

861