This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,10 @@
|
||||
# probe: ord of a one-character String (ASCII and not), and chr of a code point
|
||||
def main():
|
||||
var s = "aé€😀"
|
||||
print(ord("A"), ord(String(s[codepoint=0])), ord(String(s[codepoint=1])), ord(String(s[codepoint=2])), ord(String(s[codepoint=3])))
|
||||
print(chr(65), chr(233), chr(8364), chr(128512), chr(48))
|
||||
var c = chr(66)
|
||||
print(c, c.byte_length(), chr(233).byte_length(), chr(128512).count_codepoints())
|
||||
print(chr(ord("a") + 1) + chr(0x41))
|
||||
var k = 3
|
||||
print(chr((ord("Y") - ord("A") + k) % 26 + ord("A")))
|
||||
Reference in new issue
Block a user