Character codes: Difference between revisions

m (→‎{{header|Raku}}: twiddles)
Line 2,141:
see char(97) + nl
</syntaxhighlight>
=={{header|RPL}}==
{{in}}
<pre>
"a" NUM
97 CHR
</pre>
{{out}}
<pre>
2: 97
1: "a"
</pre>
 
=={{header|Ruby}}==
In Ruby 1.9 characters are represented as length-1 strings; same as in Python. The previous "character literal" syntax <tt>?a</tt> is now the same as <tt>"a"</tt>. Subscripting a string also gives a length-1 string. There is now an "ord" method of strings to convert a character into its integer code.
Line 2,148 ⟶ 2,160:
> 97.chr
=> "a"</syntaxhighlight>
 
=={{header|Run BASIC}}==
<syntaxhighlight lang="runbasic">print chr$(97) 'prints a
1,150

edits