how can i split string data in arduino? im sending string data via serial with following format ex. :45:60 or such as ":120:57".i got the data shown in Serial.println (secondValue) Serial.println (thirdValue); but i cant convert it to int

String myString;
char c;
int Index1,Index2,Index3, azi;
String secondValue, thirdValue;
void setup(){
Serial.begin(9600);}
void loop(){
while (Serial.available()&gt;0)
{
delay(10);
c = Serial.read();
 myString += c;
}
 if (myString.length()&gt;0)
{
Index1 = myString.indexOf(':');
Index2 = myString.indexOf(':', Index1+1);
Index3 = myString.indexOf(':', Index2+1);

secondValue = myString.substring(Index1+1, Index2);
thirdValue = myString.substring(Index2+1, Index3);


Serial.println(secondValue);
Serial.println(thirdValue);

myString="";
}
delay(1000);
}
All numbers are integers?
If yes, you can use toInt() function.

int secondValueInt, thirdValueInt;

secondValueInt = secondValueInt.toInt();
thirdValueInt = thirdValue.toInt();