Sample code for 30+ languages & platforms
Visual FoxPro

StringBuilder ReplaceWord

Demonstrates the ReplaceWord method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL loSb
LOCAL lnNumReplacements

loSb = CreateObject('Chilkat.StringBuilder')
loSb.Append("forest, lumber, lumberjack, jack, timberland")

* The ReplaceWord method replaces word occurances.

* For example:
lnNumReplacements = loSb.ReplaceWord("lumber","timber")
lnNumReplacements = loSb.ReplaceWord("jack","joe")

* The string content is now:
* forest, timber, lumberjack, joe, timberland
? loSb.GetAsString()

RELEASE loSb