C++
C++
StringBuilder ReplaceWord
Demonstrates the ReplaceWord method.Chilkat C++ Downloads
#include <CkStringBuilder.h>
void ChilkatSample(void)
{
CkStringBuilder sb;
sb.Append("forest, lumber, lumberjack, jack, timberland");
// The ReplaceWord method replaces word occurances.
// For example:
int numReplacements = sb.ReplaceWord("lumber","timber");
numReplacements = sb.ReplaceWord("jack","joe");
// The string content is now:
// forest, timber, lumberjack, joe, timberland
std::cout << sb.getAsString() << "\r\n";
}