reference-en
reference-en copied to clipboard
Behavior not documented: Stream.find() consumes the bytes and also the matched byte.
I'm refering to this function: https://www.arduino.cc/reference/en/language/functions/communication/stream/streamfind/
The behavior of the function Stream.find() is that it will consume every single byte in the inBuffer until it fins the matching target.
This is not documented nor expected from the name find(). One can expect a find() function to behave similar to peek() but it is not.
Hi @yck011522 I think that would be a good thing to document. Would you like to submit a pull request to make this improvement?
Hi @per1234. Glad you agree with me. Sorry I do not have the time now. Perhaps some other people is able give it a try.
I understand, no problem. Your suggestion is valuable in itself. I'm sure someone will act on this in the near future.
Thanks! Per