hi,
i need to have a validation if the input is valid and using hh:mm time format?
thanks,
Printable View
hi,
i need to have a validation if the input is valid and using hh:mm time format?
thanks,
And what input is valid for your mind?Can you ask clearer the question and please show what you have done,any lines of code.
Here's an algo( if you didn't try it yet )
given unknown value, and expecting there is a colon(:) on that value,
try to split the data(preferably String) through colon(:)
Check if returned String array has length of 2 (0 - 1 are despaired)
you may use the try/catch to validate the data by converting the strings into an integer
once they are valid integers, try to check if the first datum is greater than 23(max time is 23:59) and if the second datum is greater than 59,
if both comparison are satisfied, then play with those data....