End of the line

Posted on 2011-04-20
Last Modified: 2012-06-27
Hi there,

I have a record in String


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.

Question by:theartha
    LVL 14

    Accepted Solution

    The version of substring() that takes one parameter will work:


    Open in new window

    LVL 47

    Assisted Solution

    LVL 92

    Assisted Solution


    "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."


    Author Closing Comment

    Thank You

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    Multiple issues with Java 14 37
    post4 challenge 28 70
    PGP Decryption code using Bouncy Castle jars 11 69
    matchUp  challenge 9 50
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now