atoi lastindexofsubstring