Sample code for 30+ languages & platforms
Rust

Load StringTable from a StringBuilder

Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.

Chilkat Rust Downloads

Rust

let str_tab = chilkat::StringTable::new();
let sb = chilkat::StringBuilder::new();

let _ = sb.append("This is line 1\r\n");
let _ = sb.append("An empty line follows...\r\n");
let _ = sb.append("\r\n");
let _ = sb.append("This is line 4\r\n");

let _ = str_tab.append_from_sb(&sb);

let mut i = 0;
let num_strings = str_tab.count();
while i < num_strings {
    println!("{}: {}", i, str_tab.string_at(i).unwrap_or_default());
    i = i + 1;
}