FastLED 3.9.15
Loading...
Searching...
No Matches

◆ find() [4/4]

fl::size fl::string_view::find ( string_view sv,
fl::size pos = 0 ) const
inline

Definition at line 199 of file string_view.h.

199 {
200 if (sv.empty()) return pos;
201 if (pos >= mSize || sv.mSize > mSize - pos) return npos;
202
203 for (fl::size i = pos; i <= mSize - sv.mSize; ++i) {
204 bool match = true;
205 for (fl::size j = 0; j < sv.mSize; ++j) {
206 if (mData[i + j] != sv.mData[j]) {
207 match = false;
208 break;
209 }
210 }
211 if (match) return i;
212 }
213 return npos;
214 }
uint8_t pos
Definition Blur.ino:11
const char * mData
static constexpr fl::size npos
Definition string_view.h:35

References string_view(), empty(), FL_NOEXCEPT, mData, mSize, npos, and pos.

+ Here is the call graph for this function: