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
What is a jsp expression?
How are cookies set in jsp?
Explain various implicit objects in expression language.
How can I declare methods within my jsp page?
What is the difference between include directive and include action?
What is a hidden comment in jsp?
Which of the following action variable is used to include a file in jsp?
Why do we need servlets and jsp?
What is jsp and its advantages?
How jsp is executed?
Can you call jsp from servlet?
Explain the difference between servletcontext and pagecontext in jsp?
How jsp is executed by web server?
What are directives in jsp?
What is difference between jsp and javascript?