Xbase++
Xbase++
StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween method.Chilkat Xbase++ Downloads
LOCAL oSb
LOCAL cSearchAfter
LOCAL cCompanyName
oSb := CreateObject("Chilkat.StringBuilder")
oSb:Append("<abc><person><name>Joe</name></person><company><name>Chilkat Software</name></company></abc>")
// The GetAfterBetween method gets the substring between two arbitrary marker strings, and doesn't
// start searching until the searchAfter string is passed.
// For example, to get the company name in the string above...
cSearchAfter := "<company>"
cCompanyName := oSb:GetAfterBetween(cSearchAfter, "<name>", "</name>")
? "Company Name = " + cCompanyName
oSb:destroy()