The std::str documentation is also quite good.
// Create a string from a literal
let hello: &'static str = "Hello!";
let hello2: &str = "Hello!";| open ReactDOM | |
| module MyComponent = struct | |
| (* Component Properties *) | |
| type props = {count: int} | |
| (* Hey, state can be any type! *) | |
| type state = string | |
| (* Initializer *) |
The std::str documentation is also quite good.
// Create a string from a literal
let hello: &'static str = "Hello!";
let hello2: &str = "Hello!";