[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

left and len

Posted on 2004-09-16
3
Medium Priority
?
1,026 Views
Last Modified: 2006-11-17
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 ?
0
Comment
Question by:skychan
  • 2
3 Comments
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12082099
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
 

Author Comment

by:skychan
ID: 12082298
String str = new String("Test");

out.println (str.length()) ;

ok but

subinteger('1232232', str.lenght());
problem
0
 
LVL 5

Accepted Solution

by:
KarcOrigin earned 90 total points
ID: 12082463
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question