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 are jsp implicit objects?

0 Answers  


how to extends one jsp page to another jsp page with realtime example?

3 Answers   CTS, Jamcracker,


How do you comment out in jsp?

0 Answers  


how to print a string with out using out.println?

3 Answers   Elementus Technologies,


What is jsp translation time?

0 Answers  


Explain handling of runtime exceptions.

0 Answers  


What are different implicit objects of jsp?

0 Answers  


What do you know about jsp tags?

0 Answers  


Explain the difference between servlet and jsp?

0 Answers  


Q : In session created by server with client(browser) How can server find that request coming is belong to new session OR belong to session that is timeout.

4 Answers   HCL,


What class.forname will do while loading drivers?

0 Answers  


Explain the difference between forward and sendredirect?

0 Answers  


Categories