how to read user input in form minutes:seconds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • purplephilosopher
    New Member
    • Sep 2007
    • 1

    how to read user input in form minutes:seconds

    ok so if i ask the user to input time in the form of
    minutes:seconds
    so for example 5 minutes, 6 seconds would be entered as 5:06
    how can i get my program to read that (store the 5 as minutes, the 06 as seconds)
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by purplephilosoph er
    ok so if i ask the user to input time in the form of
    minutes:seconds
    so for example 5 minutes, 6 seconds would be entered as 5:06
    how can i get my program to read that (store the 5 as minutes, the 06 as seconds)
    Have a look at the String.split method.

    Comment

    Working...