#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Parsing a string using positional parameters in java


    Can anyone help me in parsing a string using positional parameters

    Ex: - String request ="0097394294793634847";

    i need a code to retrieve the value based on initial position
    and end position

    like if i say 1,3 means the value "009" should come
    if i say 4,5 means the value "7" should come
    if i say 6,7 means the value "3" should come


    and the positional parameters are dynamic values
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    103
    Rep Power
    3
    Sounds like you are looking for a nifty String method called substring. You can read, learn and practice using it by going to the following link:

    http://www.homeandlearn.co.uk/java/substring.html
  4. #3
  5. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,714
    Rep Power
    348
    Also you should become familiar with Java's API doc at:
    http://docs.oracle.com/javase/7/docs/api/

    Find the class in the lower left window, click on it and the class's doc will display in the main window.

IMN logo majestic logo threadwatch logo seochat tools logo