Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

End of the line

Posted on 2011-04-20
4
Medium Priority
?
426 Views
Last Modified: 2012-06-27
Hi there,

I have a record in String

AB123456000

I am trying to read the line in while loop,

line.substring(0, 2);
line.substring(2, 8)
line.substring(8,end of the line);

The last 3 zero's is not fixed, it can be 4 or 5 or 10 zero's, how to read from 8th character to last character.


Thanks
0
Comment
Question by:theartha
4 Comments
 
LVL 14

Accepted Solution

by:
CPColin earned 668 total points
ID: 35436663
The version of substring() that takes one parameter will work:

line.substring(8);

Open in new window

0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 664 total points
ID: 35436666
line.substring(8)
0
 
LVL 92

Assisted Solution

by:objects
objects earned 668 total points
ID: 35437071
http://download.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int)

"Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string."

0
 

Author Closing Comment

by:theartha
ID: 35442040
Thank You
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

580 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