Rust
Rust
StringBuilder RemoveAfterFinal
Demonstrates the StringBuilder.RemoveAfterFinal method.The GetBefore method was added in Chilkat v9.5.0.77
Chilkat Rust Downloads
let sb = chilkat::StringBuilder::new();
let _ = sb.append("abc::def::ghi").is_ok();
// Replace the 1st occurrence of a substring with another string.
let b_found = sb.replace_first("::", "-").is_ok();
println!("bFound = {}", b_found);
println!("sb contains: {}", sb.get_as_string().unwrap_or_default());
// Output is:
// bFound = True
// sb contains: abc-def::ghi