How to convert string variable to integer in Arduino?

How to convert a string variable to int, long in Arduino code?
ANSWER
void setup() { Serial.begin(9600); String myString = "125"; int myInt = myString.toInt(); Serial.println(myInt); } void loop() { }
COM6
Send
125
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  
void setup() { Serial.begin(9600); char myString[6] = "126"; int myInt = atoi(myString); Serial.println(myInt); } void loop() { }
COM6
Send
126
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

※ OUR MESSAGES