I get data from a serial port in ascii characters. only numeric characters are allowed and I check for illegal characters with regular expressions. This part works fine and if an illegal character presents itself the regular expression method catches it and display them in variable m. then I take the string and split it into the different words wich consists of 4 bytes each. the illegal character normaly sits as byte 1 for example "q123" the problem is that if a word contains a character other than numeric i need to change the 4 bytes to "0" and it need to be "0000" then.
should i change it in the string with string.Replace before I split it into an array or when it's an array and how?