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 / 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 |
Mention the jstl core tags.
How do I use comments within a jsp page?
What is jsp application?
What is scriptlet tag?
what are the alternate way to use the scriplet in jsp.
How do you connect to the database from jsp?
How can I declare methods within my jsp page?
How does error handling occur with jstl?
How do I open a jsp file?
what is the difference between jsp and servlets ?
Which jsp lifecycle methods can be overridden?
What are the events in jsp page?