Sample code for 30+ languages & platforms
Tcl

StringBuilder RemoveAfterFinal

Demonstrates the StringBuilder.RemoveAfterFinal method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set sb [new_CkStringBuilder]

set success [CkStringBuilder_Append $sb "abc::def::ghi"]

# Replace the 1st occurrence of a substring with another string.
set bFound [CkStringBuilder_ReplaceFirst $sb "::" "-"]

puts "bFound = $bFound"
puts "sb contains: [CkStringBuilder_getAsString $sb]"

# Output is:
# bFound = True
# sb contains: abc-def::gh

delete_CkStringBuilder $sb