Sample code for 30+ languages & platforms
Visual FoxPro

StringBuilder RemoveAfterFinal

Demonstrates the StringBuilder.RemoveAfterFinal method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loSb
LOCAL lnBFound

lnSuccess = 0

loSb = CreateObject('Chilkat.StringBuilder')
lnSuccess = loSb.Append("abc::def::ghi")

* Replace the 1st occurrence of a substring with another string.
lnBFound = loSb.ReplaceFirst("::","-")

? "bFound = " + STR(lnBFound)
? "sb contains: " + loSb.GetAsString()

* Output is:
* bFound = True
* sb contains: abc-def::gh

RELEASE loSb