Results 1 to 3 of 3
  1. #1
    mikeduch is offline Member
    Join Date
    Apr 2013
    Rep Power

    Default Need help with ArrayList<String>

    Hey guys, I am working on an assignment in which I make a weekly calendar...

    I am having trouble with grabbing a value from an ArrayList<String>, splitting it at a certain character and then putting it into another ArrayList<String>

    the calendar will contain values like: Monday@5PM, Tuesday@3AM, etc...

    If the user wants to view all appointments on Monday and have them print as 5PM 6PM 7PM etc, how do I split Monday@5PM so it only contains 5PM?


  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: Need help with ArrayList<String>

    Why do you keep those days and times joined in a single String anyway; I bet a bit of preprocessing of the data could split the times from the days so you can store them in a suitable data structure.

    kind regards,

    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Rep Power

    Default Re: Need help with ArrayList<String>

    Use the various String methods substring, charAt, split etc.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Replies: 1
    Last Post: 02-09-2013, 02:45 PM
  2. ArrayList<String>
    By PeteW44 in forum New To Java
    Replies: 12
    Last Post: 03-24-2012, 08:11 PM
  3. Replies: 12
    Last Post: 11-26-2010, 08:33 AM
  4. Replies: 1
    Last Post: 11-04-2010, 06:53 PM
  5. Putting a string into ArrayList<String>
    By k4ff1n34dd1c7 in forum New To Java
    Replies: 5
    Last Post: 03-23-2009, 05:10 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