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 ?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

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
You can also use str.substring(6) Which will return "Game" to you.

Good luck.

String str = new String("Test");

' Will give you the length of the string

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

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

out.println (str.length()) ;

ok but

subinteger('1232232', str.lenght());
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.