-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Description
In this file: https://www.rust-lang.org/en-US/faq.html#strings it refers to a .char_at() method. I've tried this on String and &str but according the the playpen neither has this method:
fn main() {
let s = "Hello, world!";
let t = s.to_string();
println!("{}", s.char_at(5));
println!("{}", t.char_at(5));
} Compiling playground v0.0.1 (file:///playground)
error[E0599]: no method named `char_at` found for type `&str` in the current scope
--> src/main.rs:4:22
|
4 | println!("{}", s.char_at(5));
| ^^^^^^^
error[E0599]: no method named `char_at` found for type `std::string::String` in the current scope
--> src/main.rs:5:22
|
5 | println!("{}", t.char_at(5));
| ^^^^^^^
error: aborting due to 2 previous errors
Metadata
Metadata
Assignees
Labels
No labels