Problem with my char

Good evening everybody
I come back to you to ask for help.
I'm trying to find how I can get a whole number.
In my program, I have 255 on the monitor
It's juste 3 character, I want the number.

I put on the monitor Rgb(255,213,165)
And I'd like to have just the 3 numbers

  ais c'est bien juste 3 caractères 
Moi je vous le nombre
Code: [Select]

String monitserie = "";
void setup() {
Serial.begin(9600);
#define red
}

void loop() {
 char str[16];
 if (Serial.available())
 {
 monitserie = Serial.readString();
 int nbCaract =  monitserie.length();
 monitserie = monitserie.substring(0, nbCaract-2);   // Pour supprimer les caractères cachée \n (Lf 0xA)  \r (Cr 0xD)

for(int rouge = 4 ; rouge< 7 ; rouge++)

 Serial.print((int) str[4]);

 }
}/code]

Your question has nothing to do with the workings of the Forum. I have suggested to the Moderator to move it to the Programming section.

Have a look at the parse example in Serial Input Basics

...R

After having read that and written a code that uses only char arrays, you should have "Rgb(255,255,255)" inside your char array str[]

To get the value 255 out of str[4] to str[6], do

redValue = (str[4]-'0')*100 + (str[5]-'0')*10 + (str[6]-'0');