Tcl
Tcl
StringBuilder RemoveAfterFinal
Demonstrates the StringBuilder.RemoveAfterFinal method.The GetBefore method was added in Chilkat v9.5.0.77
Chilkat Tcl Downloads
load ./chilkat.dll
set success 0
set sb [new_CkStringBuilder]
set success [CkStringBuilder_Append $sb "abc::def::ghi"]
# 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 0.
set marker "::"
set bFound [CkStringBuilder_RemoveAfterFinal $sb $marker]
puts "bFound = $bFound"
puts "sb contains: [CkStringBuilder_getAsString $sb]"
# Output is:
# bFound = 1
# sb contains: abc::def
delete_CkStringBuilder $sb