PureBasic
PureBasic
StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween method.Chilkat PureBasic Downloads
IncludeFile "CkStringBuilder.pb"
Procedure ChilkatExample()
sb.i = CkStringBuilder::ckCreate()
If sb.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkStringBuilder::ckAppend(sb,"<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...
searchAfter.s = "<company>"
companyName.s = CkStringBuilder::ckGetAfterBetween(sb,searchAfter,"<name>","</name>")
Debug "Company Name = " + companyName
CkStringBuilder::ckDispose(sb)
ProcedureReturn
EndProcedure