Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    Levian is offline Senior Member
    Join Date
    Jun 2011
    Posts
    109
    Rep Power
    0

    Default Re: Separating codeindexOf/substring methods + Using for different primitives/objects

    Quote Originally Posted by magichaxx View Post
    that is basically unknown until the program scans in the user input?
    Unless I get the wrong idea, I think you have it answered yourself.
    First is to make something usable, next is to aim for perfection which means a never ending improvements.

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: Separating codeindexOf/substring methods + Using for different primitives/objects

    how do i separate a section of a String thats, say, between ends of the String, that is basically unknown until the program scans in the user input?
    Can you give an example? Show some user input and the section that you want to separate.
    If you don't understand my response, don't ignore it, ask a question.

  3. #23
    magichaxx is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Separating codeindexOf/substring methods + Using for different primitives/objects

    input: name, age, gender, height, weight
    separate: every section between commas
    output:
    name
    age
    gender
    height
    weight

  4. #24
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,417
    Rep Power
    5

    Default Re: Separating codeindexOf/substring methods + Using for different primitives/objects

    The easiest way is to use String.split() as was suggested earlier.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Calling methods on objects stored in an array
    By Dreaming in forum New To Java
    Replies: 6
    Last Post: 10-30-2011, 12:50 AM
  2. Methods and Objects.
    By jim01 in forum New To Java
    Replies: 4
    Last Post: 05-15-2011, 09:07 PM
  3. Replies: 1
    Last Post: 02-03-2011, 05:43 PM
  4. creating objects by methods automatically
    By thedarlington in forum New To Java
    Replies: 13
    Last Post: 02-07-2010, 10:48 PM
  5. Separating program logic and GUI
    By loopingman in forum AWT / Swing
    Replies: 0
    Last Post: 12-08-2008, 02:46 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •