(DataFlex) StringBuilder RemoveBefore
Demonstrates the StringBuilder.RemoveBefore method.
The GetBefore method was added in Chilkat v9.5.0.77
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoSb
Boolean iSuccess
String sMarker
Boolean iBFound
String sTemp1
Get Create (RefClass(cComChilkatStringBuilder)) To hoSb
If (Not(IsComObjectCreated(hoSb))) Begin
Send CreateComObject of hoSb
End
Get ComAppend Of hoSb "http://www.chilkatsoft.com" To iSuccess
// 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 False.
Move "//" To sMarker
Get ComRemoveBefore Of hoSb sMarker To iBFound
Showln "bFound = " iBFound
Get ComGetAsString Of hoSb To sTemp1
Showln "sb contains: " sTemp1
// Output is:
// bFound = True
// sb contains: www.chilkatsoft.com
End_Procedure
|