Sample code for 30+ languages & platforms
Visual Basic 6.0

StringBuilder RemoveAfterFinal

Demonstrates the StringBuilder.RemoveAfterFinal method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim sb As New ChilkatStringBuilder
success = sb.Append("abc::def::ghi")

' Replace the 1st occurrence of a substring with another string.
Dim bFound As Long
bFound = sb.ReplaceFirst("::","-")

Debug.Print "bFound = " & bFound
Debug.Print "sb contains: " & sb.GetAsString()

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