(DataFlex) StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween method.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoSb
Boolean iSuccess
String sSearchAfter
String sCompanyName
Get Create (RefClass(cComChilkatStringBuilder)) To hoSb
If (Not(IsComObjectCreated(hoSb))) Begin
Send CreateComObject of hoSb
End
Get ComAppend Of hoSb "<abc><person><name>Joe</name></person><company><name>Chilkat Software</name></company></abc>" To iSuccess
// 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...
Move "<company>" To sSearchAfter
Get ComGetAfterBetween Of hoSb sSearchAfter "<name>" "</name>" To sCompanyName
Showln "Company Name = " sCompanyName
End_Procedure
|