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 |
How to make a “new line in html” in jsp?
Why is _jspservice() method starting with an '_' while other life cycle methods do not?
Can we override jsp service method?
What are the different types of jsp tags?
Can jsp run without server?
What is jsp in javascript?
What is an api with example?
Why does jcomponent have add() and remove() methods but the component does not?
What are jsp and servlets?
What is the difference between jsp and php?
What is jsp standard tag library, provide some example usage?
What is session tracking in jsp?