Sample code for 30+ languages & platforms
Unicode C++

StringBuilder RemoveAfterFinal

Demonstrates the StringBuilder.RemoveAfterFinal method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkStringBuilderW.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkStringBuilderW sb;
    success = sb.Append(L"abc::def::ghi");

    //  Replace the 1st occurrence of a substring with another string.
    bool bFound = sb.ReplaceFirst(L"::",L"-");

    wprintf(L"bFound = %d\n",bFound);
    wprintf(L"sb contains: %s\n",sb.getAsString());

    //  Output is:
    //  bFound = True
    //  sb contains: abc-def::ghi
    }