Serial.readStringUntil()

Description

readStringUntil() reads characters from the serial buffer into a String. The function terminates if it times out (see setTimeout()).

Serial.readStringUntil() inherits from the Stream utility class.

Syntax

Serial.readStringUntil(terminator)

Parameter Values

  • Serial: serial port object. See the list of available serial ports for each board on the Serial main page.
  • terminator: the character to search for. Allowed data types: char.

Return Values

  • The entire String read from the serial buffer, up to the terminator character

※ NOTES AND WARNINGS:

The terminator character is discarded from the serial buffer.

See Also

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.