How can you get the total number of charater in a string in jsp. example:
"name" is a string and it's total character is 4
dude this is a php forum. however
xyz = strlen("name")
xyz should contain 4, define xyz as integer type.
cheers nilesh.
Strings in Java have a length() method that returns an int.
See this in the API: http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html#length()
In order to get the length variable use this code:
<% String myString = new String("the string"); int len = myString.length();
out.println("String Length is " + len); %>