find()
描述
find()
可以从串流中读取资料,并且找到给定长度的目标字串。假如有找到目标字串,则回传 true,一段时间内没找到目标字串,则回传 false。
这个函式是 Stream 类别的一部分,它可以被任何继承 Stream 的类别呼叫 (例如:Wire、Serial 等等) 。
语法
stream.find(target)
参数
stream
: 一个类别的实例,这个类别是继承于 Stream
target
: 要找的字串 (char string)
回传
布林值
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.