Screenshot of the godot docs saying the following: int to_int() const Converts the string representing an integer number into an int. This method removes any non-number character and stops at the first decimal point (.). See also is_valid_int(). [examples omitted]
https://scaliezone.files.fedi.monster/media_attachments/files/113/066/048/527/029/603/original/7dca5e86ba32f629.png