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?



i have one jsp page. inside this, String s=req.getParameter("raja");...... now we want ..

Answer / 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

More JSP Interview Questions

What is context in jsp?

0 Answers  


Mention some important jsp action tags.

0 Answers  


What is session management in jsp?

0 Answers  


Explain the difference between servlet and jsp?

0 Answers  


Which tag should be used to pass information from jsp to include jsp?

0 Answers  


What is the differences between the jsp custom tags and java beans?

0 Answers  


HOW CAN WE COMPARE TWO PDF FILES USING JSP ?

0 Answers   TCS,


What are directives? What are the different types of directives available in jsp?

0 Answers  


What is a page directive?

0 Answers  


How do you restrict page errors display in the JSP page?

2 Answers   IBM, TCS,


How to access java variable in jsp?

0 Answers  


Which tag is used for error handling in jsp pages?

0 Answers  


Categories