MCPcopy Create free account
hub / github.com/SmingHub/Sming / trim

Method trim

Sming/Wiring/WString.cpp:905–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

903}
904
905void String::trim(const char* set)
906{
907 auto len = length();
908 if(len == 0) {
909 return;
910 }
911 auto buf = buffer();
912 char* begin = buf;
913 while(strchr(set, *begin)) {
914 begin++;
915 }
916 char* end = buf + len - 1;
917 while(strchr(set, *end) && end >= begin) {
918 end--;
919 }
920 len = end + 1 - begin;
921 if(begin > buf) {
922 memmove(buf, begin, len);
923 }
924 setlen(len);
925}
926
927String& String::pad(int16_t minWidth, char c)
928{

Callers 15

jquery.jsFile · 0.45
jquery.jsFile · 0.45
initFunction · 0.45
jquery.jsFile · 0.45
executeMethod · 0.45
WaveDrom.jsFile · 0.45
onHeadersCompleteMethod · 0.45
bindMethod · 0.45
headersCompleteMethod · 0.45
convertFQNFunction · 0.45
jquery.jsFile · 0.45
jquery.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected