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

difference betwwn 16 bit and 32 bit

0 Answers   Huawei, TechSoft,


Which method cannot be overridden in jsp?

0 Answers  


What is the purpose of creating custom tags?

0 Answers  


How do you delete the session data?

0 Answers  


What is jsp expression?

0 Answers  


What is use of scriptlet tags in jsp?

0 Answers  


Can constructor be used instead of init(), to initialize servlet?

0 Answers  


Why are jsp pages the preferred api for creating a web-based client program?

0 Answers  


How can I override the jspdestroy() method within a jsp page?

0 Answers  


Explain client-side and server-side validation.

0 Answers  


Which one is better jsp or servlet?

0 Answers  


What's the difference between javabeans and taglib directives?

0 Answers  


Categories