Sample code for 30+ languages & platforms
Node.js

StringBuilder ReplaceWord

Demonstrates the ReplaceWord method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var sb = new chilkat.StringBuilder();
    sb.Append("forest, lumber, lumberjack, jack, timberland");

    //  The ReplaceWord method replaces word occurances.

    //  For example:
    var numReplacements = sb.ReplaceWord("lumber","timber");
    numReplacements = sb.ReplaceWord("jack","joe");

    //  The string content is now:
    //  forest, timber, lumberjack, joe, timberland
    console.log(sb.GetAsString());

}

chilkatExample();