Sample code for 30+ languages & platforms
AutoIt

StringBuilder ReplaceWord

Demonstrates the ReplaceWord method.

Chilkat AutoIt Downloads

AutoIt
$oSb = ObjCreate("Chilkat.StringBuilder")
$oSb.Append("forest, lumber, lumberjack, jack, timberland")

; The ReplaceWord method replaces word occurances.

; For example:
Local $iNumReplacements = $oSb.ReplaceWord("lumber","timber")
$iNumReplacements = $oSb.ReplaceWord("jack","joe")

; The string content is now:
; forest, timber, lumberjack, joe, timberland
ConsoleWrite($oSb.GetAsString() & @CRLF)