Ignoring Characters read through serial.read

Hello,

New to Arduino programming and used the forums to complete 90% of the code but come stuck.

I am trying to ignore characters during the serial.read process so that they are not added to the char array.

I am able to collect all data required but need to strip “:” and “lower case letters” out as each character is received.

Here is the code I have to complete this part

const int numChars = 300;
char receivedChars[numChars];
boolean newData = false;

void setup() {
    Serial.begin(9600);
} 

void loop() {
  for (int i = 0; i < 1500; i++){
    recvWithStartEndMarkers();
    delay(10);
}
delay(1000);
   Serial.println(receivedChars);
}

void recvWithStartEndMarkers() {
    static boolean recvInProgress = false;
    static int ndx = 0;
    char startMarker = ',M';
    char endMarker = 'OK';
    char rc;
 
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();
  
        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }
}


}

Any help would be greatly appreciated.

+1 for using code tags on your first post

something like this

while (Serial.available() > 0 && newData == false) {

        rc = Serial.read();  // get char


        if ( rc == ':'  ||  (  rc >= 97 && rc <=  123  ) ) {

         continue;    // skips it

        }

97 as ascii for ‘a’ ( lower case ‘A’ )

Read too many posts requesting to use code tags...

Works perfectly, thanks!

Simple after studying your answer.

char startMarker = ',M';
char endMarker = 'OK';

These are not single characters.