I tried the code from Andy Brown, but i wont work fir me the problem is i think that i want to replace "80" with "1B1F" and it seems to mee that in my case it will nok be an efficient way to it like that, so do some buddy now how i do this in the best way?
I have to look through i array of char and search for 5 different character as you see below and relapse them if they curs
Like if i find "80" it has to be relapsed with "1B7F"
and "40" [ch8594] "1BBF"
You seem to require a lot of functionality offered by the Arduino String object. In your last topic you needed to find a substring, now you want to replace one substring with another. With this object, you can do both. Have you tried this class?
There are a lot of values in OPs array that are not printable characters, so strings won't work.
Oh, I didn't realise the Arduino String object can't safely handle non-printable characters. It can't, though?
(Edit: Ah yes, the problem would occur only if there's a null-byte in the char array, right? That would cut off any String-implemention. Good catch, thank you. If there's guaranteed to be no null-bytes, the String-object should work, though.)
If this is the case, I think something like the next approach is needed:
1. Count the number of replacements you want to make in the array. 2. If count > 0, calculate the length of the new array you want to make. 3. Create new array of proper length. 4. Loop though the original array, copying all chars into the new array, unless they are to be replaced, in which case you copy the replacement characters.
Because you can't change the length of a created array, this seems to me the most practical approach.