The Standard LibrarynumberMethodsstoiOn this pagestoiConvert a string to an integer. stoi("123", 10); //123stoi("0xff", 16), //255 Syntax stoi(string, base) Returns The string as an integer on success. Undefined when the string cannot be converted.