Idiomatically determine all the lowercase and uppercase letters: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: look beyond just ASCII) |
(Added a precision regarding the possibility to use of Unicode letters and digits in identifiers.) |
||
Line 946: | Line 946: | ||
Nim has a <code>char</code> type whose values are contained in a single bit. The values from 0 to 127 are the ASCII characters. Strings are composed of char values but they are considered to be encoded in UTF-8. So accessing an individual character of a string may have no meaning when not working in ASCII. |
Nim has a <code>char</code> type whose values are contained in a single bit. The values from 0 to 127 are the ASCII characters. Strings are composed of char values but they are considered to be encoded in UTF-8. So accessing an individual character of a string may have no meaning when not working in ASCII. |
||
Note that Nim allows to work with full Unicode, either by using strings encoded in UTF-8 (but with limited possibilities) or by using the runes of the module “unicode”. Identifiers may contain Unicode letters or digits as in “θ₁”, “â”, “x₁”, “x³”. |
|||
The following program displays the lowercase and uppercase ASCII letters. |
|||
<syntaxhighlight lang="nim">import sequtils, strutils |
<syntaxhighlight lang="nim">import sequtils, strutils |