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

Explain jsp:plugin action?

0 Answers  


What are jsp el implicit objects and how it’s different from jsp implicit objects?

0 Answers  


How can information from one JSP be passed to another JSP?

0 Answers  


How run jsp program in netbeans?

0 Answers  


what is jsp? a technology ,a language or something else ?

3 Answers   Mastek,






How can I use jsp in the mvc model?

0 Answers  


What is a javaserver pages (jsp)?

0 Answers  


How do you delete the session data?

0 Answers  


What is out println in jsp?

0 Answers  


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

0 Answers  


Is jsp platform dependent?

0 Answers  


How do I create a dynamic web project?

0 Answers  


Categories