Rust
Rust
StringBuilder ReplaceWord
Demonstrates the ReplaceWord method.Chilkat Rust Downloads
let sb = chilkat::StringBuilder::new();
let _ = sb.append("forest, lumber, lumberjack, jack, timberland");
// The ReplaceWord method replaces word occurances.
// For example:
let mut num_replacements = sb.replace_word("lumber", "timber");
num_replacements = sb.replace_word("jack", "joe");
// The string content is now:
// forest, timber, lumberjack, joe, timberland
println!("{}", sb.get_as_string().unwrap_or_default());