Arrays 如何打印数组和向量?

Arrays 如何打印数组和向量?,arrays,vector,printing,rust,Arrays,Vector,Printing,Rust,我在玩Rust,我想知道如何打印数组和向量 let a_vector = vec![1, 2, 3, 4, 5]; let an_array = ["a", "b", "c", "d", "e"]; 我想在屏幕上打印,结果应该是: [1, 2, 3, 4, 5] ["a", "b", "c", "d", "e"] 在python中,它是: lst = ["a", "b", "c", "d", "e"] print lst 打印它会显示: ["a", "b", "c", "d", "e"]

我在玩Rust,我想知道如何打印数组和向量

let a_vector = vec![1, 2, 3, 4, 5];
let an_array = ["a", "b", "c", "d", "e"];
我想在屏幕上打印,结果应该是:

[1, 2, 3, 4, 5]
["a", "b", "c", "d", "e"]
在python中,它是:

lst = ["a", "b", "c", "d", "e"]
print lst
打印它会显示:

["a", "b", "c", "d", "e"]
{:?}
用于打印实现调试特性的类型。常规的
{}
将使用Vec和数组没有实现的显示特性


{:?}
用于打印实现调试特性的类型。常规的
{}
将使用Vec和数组没有实现的显示特性。

您看到了吗?另外,请阅读。在本例中,您应该包括您已经尝试过的内容。最好是包含一个。我也强烈推荐阅读,团队花了很多时间在阅读上。谢谢你的推荐。你看到了吗?另外,请阅读。在本例中,您应该包括您已经尝试过的内容。最好是包含一个。我还强烈建议大家阅读,团队花了很多时间在阅读上。感谢大家的建议。这只适用于最多32个数组(“数组只有长度为0..=32的std-trait实现”)。是否有一种简单的方法可以打印较长数组的内容?该方法仅适用于长度不超过32的数组(“数组只有长度为0..=32的std-trait实现”)。有没有一种简单的方法可以打印较长数组的内容?
println!("{:?}", a_vector);
println!("{:?}", an_array);