using a # from a string

A15wardn (2)
I have a string based program, and you need to use the first input as the operation (i.e add, subtract) and the number after the command (for example add3, but it can be any number from 1 - 8) to determine how many letters at the end (or the beginning if its subtract) of the other input (an 8 letter string composed of letters from a-h) to delete. But the first input that contains the operation AND the number is a string. I tried using a substring with where that number would be and using it in my string.erase(#, 8) where # is an int or a string but you cant do that.
DTSCode (27)
use c. look up getch and putch
L B (3806)
Is there a space separating the operator from the number?

(You don't have to use C, getch, or putch btw - that's just if you can't use C++)
SIK (167)
can you list a few examples illustrating various components of the input(s).
Registered users can post here. Sign in or register to post.