readStringUntil()
描述
readStringUntil()
可以從串流中讀取字元,然後儲存成字串後回傳。這個函式會在收到結尾字元,或者指定時間內沒收到任何值後停止 (時間的設定可參考 setTimeout())。
這個函式是 Stream 類別的一部分,它可以被任何繼承它的類別呼叫 (例如:Wire、Serial 等等) 。
語法
stream.readString(terminator)
參數
stream
: 一個類別的實例,這個類別是繼承於 Stream
terminator
: 結尾字元 (char 型別)
回傳
從串流讀到的字串,直到指定的結尾字元。
See also
- Stream
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.