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

Method join

Sming/Core/Data/CStringArray.cpp:172–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172String CStringArray::join(const String& separator) const
173{
174 if(isNull()) {
175 return nullptr;
176 }
177 unsigned len = length();
178 if(len == 0) {
179 return "";
180 }
181 len -= count(); // NUL separators
182 len += separator.length() * (stringCount - 1);
183 String s;
184 s.reserve(len);
185 for(auto it = begin(); it != end(); ++it) {
186 if(it.index() != 0) {
187 s += separator;
188 }
189 s += *it;
190 }
191 return s;
192}

Callers 15

gbFunction · 0.45
jquery.jsFile · 0.45
gbFunction · 0.45
jquery.jsFile · 0.45
gbFunction · 0.45
jquery.jsFile · 0.45
mainFunction · 0.45
executeMethod · 0.45
fix_api_indexFunction · 0.45
buildFileMapFunction · 0.45
WaveDrom.jsFile · 0.45
lFunction · 0.45

Calls 3

reserveMethod · 0.80
indexMethod · 0.80
lengthMethod · 0.45

Tested by 1

mainFunction · 0.36