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

    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?


    Thanks!

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,523
    Blog Entries
    7
    Rep Power
    20

    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,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    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
  •