Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By jim829

Thread: ArrayList getting a substring?

  1. #1
    AwzumSauze is offline Member
    Join Date
    Feb 2014
    Posts
    3
    Rep Power
    0

    Question ArrayList getting a substring?

    I need help with a part of my code,
    How do you get a string in an ArrayList that has, for example, Bas in it?

    Baseball
    Base
    Basket
    Baskin
    so on so forth.

  2. #2
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,377
    Rep Power
    5

    Default Re: ArrayList getting a substring?

    What have you tried? Do you know how to determine if a given string has Bas in it?

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

  3. #3
    AwzumSauze is offline Member
    Join Date
    Feb 2014
    Posts
    3
    Rep Power
    0

    Exclamation Re: ArrayList getting a substring?

    Quote Originally Posted by jim829 View Post
    What have you tried? Do you know how to determine if a given string has Bas in it?

    Regards,
    Jim
    No, I have no idea. It's something new to me. I don't really use ArrayLists.

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

    Default Re: ArrayList getting a substring?

    Forget about ArrayLists for now. If I give you some random string, do you know how to determine if it contains the substring "bas"?

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

  5. #5
    AwzumSauze is offline Member
    Join Date
    Feb 2014
    Posts
    3
    Rep Power
    0

    Default Re: ArrayList getting a substring?

    No idea.

  6. #6
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,377
    Rep Power
    5

    Default Re: ArrayList getting a substring?

    First, check out the String class in the Java JDK documentation. There should be some methods there. If you are teaching yourself Java I suggest you look at the Oracle tutorials in my signature.

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

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default Re: ArrayList getting a substring?

    If you don't know about something: read about it. Such simple logic.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Getting substring ???
    By hacikho in forum New To Java
    Replies: 9
    Last Post: 11-29-2011, 05:17 AM
  2. Replies: 12
    Last Post: 07-07-2011, 08:49 PM
  3. Help with substring
    By hiklior in forum New To Java
    Replies: 12
    Last Post: 06-28-2008, 06:48 AM
  4. How can i get substring
    By 82rathi.angara in forum New To Java
    Replies: 14
    Last Post: 06-27-2008, 04:35 AM
  5. substring
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-11-2007, 08:15 PM

Posting Permissions

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