Is there an easy way to apply a step during iteration? I have seen a reference to step_by() in the book but I cant seem to get it to work.
For example, to print every-other character of a string I can do this but is there an easier way?
let s1 = "whhaatt".to_string();
for letter in s1.chars().enumerate() {
let (i, l) = letter;
if i % 2 == 0 {
println!("{:?}", l );
}
}
RangeandRangeFrom.