Idiomatically determine all the lowercase and uppercase letters: Difference between revisions
Content added Content deleted
(Added a precision regarding the possibility to use of Unicode letters and digits in identifiers.) |
(Jakt) |
||
Line 793: | Line 793: | ||
<syntaxhighlight lang="j"> (#~ tolower ~: toupper) u: i.65536 |
<syntaxhighlight lang="j"> (#~ tolower ~: toupper) u: i.65536 |
||
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</syntaxhighlight> |
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</syntaxhighlight> |
||
=={{header|Jakt}}== |
|||
<syntaxhighlight lang="jakt"> |
|||
fn main() { |
|||
mut lower = StringBuilder::create() |
|||
// Iteration as code points (u32) |
|||
for code_point in 'a'..('z' + 1) { |
|||
lower.append(code_point) |
|||
} |
|||
println("{}", lower.to_string()) |
|||
mut upper = StringBuilder::create() |
|||
// Iteration as ASCII bytes (u8), same result |
|||
for b in b'A'..(b'Z' + 1) { |
|||
upper.append(b) |
|||
} |
|||
println("{}", upper.to_string()) |
|||
} |
|||
</syntaxhighlight> |
|||
=={{header|Java}}== |
=={{header|Java}}== |