(DataFlex) StringBuilder RemoveAfterFinal
Demonstrates the StringBuilder.RemoveAfterFinal 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 "abc::def::ghi" To iSuccess
// The RemoveAfterFinal method removes the chars after the final occurrence of the marker.
// It also removes the marker string.
// If the marker is not found, then nothing is removed and the method returns False.
Move "::" To sMarker
Get ComRemoveAfterFinal Of hoSb sMarker To iBFound
Showln "bFound = " iBFound
Get ComGetAsString Of hoSb To sTemp1
Showln "sb contains: " sTemp1
// Output is:
// bFound = True
// sb contains: abc::def
End_Procedure
|