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
How can we avoid direct access of jsp pages from client browser?
Is the session object always created on the jsp page, is it possible to disable its creation?
Why jsp and servlets are used?
What are the implicit, internal objects and methods on the jsp page?
Which package does jsp api consist of?
Why use of scripting elements in jsp is discouraged?
How can the applets be displayed in the jsp? Explain with an example.
What is scriptlet in jsp?
How do I create a dynamic web project?
What is a declaration statement?
What is the purpose of
What is jsp declaration?
What is the purpose of jsp?
How to print java variable in jsp?
Why does jcomponent have add() and remove() methods but the component does not?