PowerShell
PowerShell
StringBuilder ReplaceWord
Demonstrates the ReplaceWord method.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$sb = New-Object Chilkat.StringBuilder
$sb.Append("forest, lumber, lumberjack, jack, timberland")
# The ReplaceWord method replaces word occurances.
# For example:
$numReplacements = $sb.ReplaceWord("lumber","timber")
$numReplacements = $sb.ReplaceWord("jack","joe")
# The string content is now:
# forest, timber, lumberjack, joe, timberland
$($sb.GetAsString())