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

◆ substring()

template<fl::size SIZE = FASTLED_STR_INLINED_SIZE>
StrN fl::StrN< SIZE >::substring ( fl::size start,
fl::size end ) const
inline

Definition at line 524 of file str.h.

524 {
525 // short cut, it's the same string
526 if (start == 0 && end == mLength) {
527 return *this;
528 }
529 if (start >= mLength) {
530 return StrN();
531 }
532 if (end > mLength) {
533 end = mLength;
534 }
535 if (start >= end) {
536 return StrN();
537 }
538 StrN out;
539 out.copy(c_str() + start, end - start);
540 return out;
541 }
char * end()
Definition str.h:354
const char * c_str() const
Definition str.h:326
void copy(const char *str)
Definition str.h:164
StrN()=default
fl::size mLength
Definition str.h:140

References StrN(), c_str(), copy(), end(), and mLength.

Referenced by substr(), substr(), and trim().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: