Rust Const String

[Solved] Rust Const String | Rust - Code Explorer | yomemimo.com
Question : rust const string

Answered by : snefden-applications

// construction:
// const name : type = value
fn main() { const TEXT : &str = "Hallo Welt!"; // little test print!("{}", TEXT);
}
// Important to know:
// The type must be specified, because alternatively an error occurs when compiling.

Source : | Last Update : Tue, 05 Apr 22

Answers related to rust const string

Code Explorer Popular Question For Rust