Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

Programming 1 (BI)
  ▸ exercises
  ▸ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C#
* D lang.
* Java
* Nim
* Nim2
  + exercises
* XC=BASIC
* old
  ✦C++, ✦Clojure, ✦Scala


[ edit | logout ]
[ sandbox | passwd ]

chr()

Nim's chr() will only work with ASCII.

chr()
print(chr(65))  # 'A'

print(chr(97))  # 'a'

print(chr(8594))  # '→'
echo chr(65)    # 'A'

echo chr(97)    # 'a'

# echo chr(8594)   # ERROR
# Error: cannot convert 8594 to range 0..255(int)

Nim's chr() is a function that returns a char, and a char is 1 byte.

Unicode support

import std/unicode    # Rune


echo Rune(65)     # A

echo Rune(97)     # a

echo Rune(8594)   # →

A Rune is an int32 that can represent any Unicode character. echo knows how to print it.

ASCII is a subset of Unicode, so it also works with "normal" ASCII characters.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2026 April 09, 09:03