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

Why should we not configure jsp standard tags in web.xml?

605


How clear chache and buffer of opera browser.

2029


Explain the action.

597


Define Composition.

654


Give the syntax for jsp comments.

574






Can you use javascript in jsp?

567


What information is needed to create a tcp socket?

597


Explain jsp action elements or action tags?

581


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

595


Explain client and server side validation?

590


When the destroy method of the jsp's are called?

568


What are the implicit objects in jsp?

588


How do I mix jsp and ssi #include? What is the difference between include directive & jsp:include action?

595


What is the jsp?

615


How to call java method in jsp page on button click?

1101