Generate lower case ASCII alphabet: Difference between revisions

Content added Content deleted
(Use `b'a'` instead of `'a' as u8`, put .map on a new line to shorten line length and replace _ with `char`)
Line 1,371:
 
=={{header|Rust}}==
<lang rust>fn main() {
fn main() {
// An iterator over the lowercase alpha's
let ascii_iter = (0..26).map(|x| (x + 'a' as u8) as char);
.map(|x| (x + b'a') as char);
 
println!("{:?}", ascii_iter.collect::<Vec<_char>>());
}
}</lang>
{{out}}
<pre>
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
</pre>
 
 
=={{header|S-lang}}==