left and len

hi everbody
i want to use left and len function but
i don't know syntax these function
could yo tell me how use ..
and which do i improt cllass my jsp page ?
skychanAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
KarcOriginConnect With a Mentor Commented:
Do like this:

To apply the left function you can use substring() funtion of String class.

The substring(int, int) method is used for extracting a contiguous portion of a string. The first integer represents the starting index, the second integer is the ending index. You can also use substring(int) function which will take the starting index of your string and the ending index will be considered as length of the string.

Question: Why you have used subinteger() function??

The santax example of substring function is as follows -

String str = new String("Testing Game");
str.substring(0,6) will return
Testing
You can also use str.substring(6) Which will return "Game" to you.

Good luck.

0
 
KarcOriginCommented:
String str = new String("Test");

' Will give you the length of the string
str.length()

There is no Left function in JSP. Rather you can use
substring(intBeginIndex)
Or
substring(intBeginIndex, intEndIndex)

I hope it will give you some idea.
Thanks
0
 
skychanAuthor Commented:
String str = new String("Test");

out.println (str.length()) ;

ok but

subinteger('1232232', str.lenght());
problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.