Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Character-codes/Eiffel/character-codes.e
Normal file
28
Task/Character-codes/Eiffel/character-codes.e
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class
|
||||
APPLICATION
|
||||
inherit
|
||||
ARGUMENTS
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
local
|
||||
c8: CHARACTER_8
|
||||
c32: CHARACTER_32
|
||||
do
|
||||
c8 := '%/97/' -- using code value notation
|
||||
c8 := '%/0x61/' -- same as above, but using hexadecimal literal
|
||||
print(c8.natural_32_code) -- prints "97"
|
||||
print(c8) -- prints the character "a"
|
||||
|
||||
c32 := 'a' -- using character literal
|
||||
print(c32.natural_32_code) -- prints "97"
|
||||
print(c32) -- prints "U+00000061"
|
||||
|
||||
--c8 := 'π' -- compile-time error (c8 does not have enough range)
|
||||
c32 := 'π' -- assigns Unicode value 960
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue