Sample code for 30+ languages & platforms
Xbase++

StringBuilder RemoveBefore

Demonstrates the StringBuilder.RemoveBefore method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oSb
LOCAL cMarker
LOCAL nBFound

nSuccess := 0

oSb := CreateObject("Chilkat.StringBuilder")
nSuccess := oSb: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.
cMarker := "//"
nBFound := oSb:RemoveBefore(cMarker)

? "bFound = " + Str(nBFound)
? "sb contains: " + oSb:GetAsString()

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

oSb:destroy()