Extracting Int from String

Hey Guys,
I have a question: Ive got a String LED GREEN 1 and LED RED 1 and i want the Integer at the end. Im prob just a idiot
Thx anyway

The terms String and string are not the same and cannot be used interchangeably.

If you were working with strings (null terminated character arrays) you could use strtok() to separate the parts of the string and atoi() to convert the last part to an int.

try sscanf()
you might try capturing the color as well

char color [10];
int   val;

    const char *s = "LED GREEN 1";  
    sscanf (s, "LED %s %d", color, &val);

Thanks