String to int while containing characters

java

Solution

- `split` the string according to `:`

- For each `int` in the resulting array, apply `parseInt`

Problem

Simple question but I am having trouble. I have an String input that is in this format `12:43`. (MM:SS). I am trying to convert this string in to `int` (seconds). The only part I don't know how to do is how to get `12` and `43` without getting `invalid double error`. Because it is containing that `":"` in the string, I can't do the usual `Parse.parseInt(string);` .

Original source