Sample code for 30+ languages & platforms
Visual FoxPro

StringBuilder RemoveBefore

Demonstrates the StringBuilder.RemoveBefore method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loSb
LOCAL lcMarker
LOCAL lnBFound

lnSuccess = 0

loSb = CreateObject('Chilkat.StringBuilder')
lnSuccess = loSb.Append("http://www.chilkatsoft.com")

* The RemoveBefore method removes the chars up to and including the marker string.
* If the marker is not found, then nothing is removed and the method returns 0.
lcMarker = "//"
lnBFound = loSb.RemoveBefore(lcMarker)

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

* Output is:
* bFound = 1
* sb contains: www.chilkatsoft.com

RELEASE loSb