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 |
What is context in jsp?
Mention some important jsp action tags.
What is session management in jsp?
Explain the difference between servlet and jsp?
Which tag should be used to pass information from jsp to include jsp?
What is the differences between the jsp custom tags and java beans?
HOW CAN WE COMPARE TWO PDF FILES USING JSP ?
What are directives? What are the different types of directives available in jsp?
What is a page directive?
How do you restrict page errors display in the JSP page?
How to access java variable in jsp?
Which tag is used for error handling in jsp pages?