Sample code for 30+ languages & platforms
Rust

AppendArrayItems Example

Demonstrates the AppendArrayItems function.

Note: This example requires Chilkat v9.5.0.82 or above.

Chilkat Rust Downloads

Rust
let jarr1 = chilkat::JsonArray::new();
let _ = jarr1.load("[ 1, 2, 3, 4]");

let jarr2 = chilkat::JsonArray::new();
let _ = jarr2.load("[ 5, 6, 7, 8]");

let _ = jarr1.append_array_items(&jarr2);

println!("{}", jarr1.emit().unwrap_or_default());
// Expected output: [1,2,3,4,5,6,7,8]

println!("{}", jarr2.emit().unwrap_or_default());
// Expected output: [5,6,7,8]