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?



i have one jsp page. inside this, String s=req.getParameter("raja");...... now we want ..

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

Post New Answer

More JSP Interview Questions

Why jsp and servlets are used?

0 Answers  


What is tag file in jsp?

0 Answers  


What's the difference between an import and include directive, and also the difference between include directive and include action?

1 Answers  


What is the full form of jsp?

0 Answers  


What is the purpose of creating custom tags?

0 Answers  






What is iselignored in jsp?

0 Answers  


how to connect the back end with Directive tag in jsp ...

1 Answers  


How do you delete a cookie within a jsp?

0 Answers  


What are the jsp standard actions?

0 Answers  


What is jsessionid?

0 Answers  


Is jsp page extensible true false?

0 Answers  


Explain JSP directives.

0 Answers  


Categories