MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / ofStringReplace

Function ofStringReplace

Source/OpenFrameworksPort.cpp:529–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529void ofStringReplace(std::string& input, std::string searchStr, std::string replaceStr, bool firstOnly /*= false*/)
530{
531 size_t uPos = 0;
532 size_t uFindLen = searchStr.length();
533 size_t uReplaceLen = replaceStr.length();
534
535 if (uFindLen == 0)
536 {
537 return;
538 }
539
540 for (; (uPos = input.find(searchStr, uPos)) != std::string::npos;)
541 {
542 input.replace(uPos, uFindLen, replaceStr);
543 uPos += uReplaceLen;
544
545 if (firstOnly)
546 break;
547 }
548}
549
550//%Y-%m-%d-%H-%M-%S-%i
551std::string ofGetTimestampString(std::string in)

Callers 15

PollMethod · 0.85
ReadMethod · 0.85
OnDeviceChangedMethod · 0.85
DrawMethod · 0.85
UpdateOldControlNameMethod · 0.85
SavePrefabMethod · 0.85
UpdatePrefabNameMethod · 0.85
PollMethod · 0.85
UpdateDisplayMethod · 0.85
CleanUpSaveMethod · 0.85
SaveKitsMethod · 0.85
FindModuleMethod · 0.85

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected