rustRust console program example
This is an example of a Rust console program that prints "Hello World!" to the console:
fn main() {
println!("Hello World!");
}
Output example
Hello World!
The code consists of the following parts:
-
fn main()
: This is the main function of the program. It is the entry point of the program and is called when the program is executed. -
println!("Hello World!");
: This line prints the string "Hello World!" to the console.
Helpful links
Related
More of Rust
- How to get a capture group using Rust regex?
- How to find the first match in a Rust regex?
- How to use regex to match a group in Rust?
- How to use regex to match a double quote in Rust?
- How to parse JSON string in Rust?
- How to match the end of a line in a Rust regex?
- How to use regex with bytes in Rust?
- How to calculate the inverse of a matrix in Rust?
- How to replace a capture group using Rust regex?
- How to replace all matches using Rust regex?
See more codes...