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

what is the extended star schema

2732


What are stored procedures? How is it useful?

946


What is difference between jspwriter and servlet printwriter?

1000


What is jsp application?

905


What is the requirement of a tag library?

908


How many tags are provided in jstl?

1126


What are the primary differences between the jsp custom tags and java beans?

885


Define scriptlet, expression and declaration in jsp?

937


How do I run a jsp file in linux?

979


What language is jsp?

1027


Explain static method?

1038


What is jsp expression language and what are it’s benefits?

1160


What are scriptlets in jsp?

1063


Where is jsp used?

899


What are the different scope values for the tag?

889