runes.v implemented

This commit is contained in:
Vinicius Silva 2023-12-26 17:36:27 -03:00
parent 2dc091356d
commit 3e9479f7cf
1 changed files with 21 additions and 0 deletions

21
03_variables/runes.v Normal file
View File

@ -0,0 +1,21 @@
pub fn main()
{
rocket := `🚀`
assert rocket.str() == '🚀'
println(rocket)
assert rocket.bytes() == [u8(0xf0),0x9f, 0x9a,0x80]
assert `\x61` == `a`
assert `\x141` == `a`
assert `\x0061` == `a`
rocket_string := '🚀'
assert rocket_string[0] != `🚀`
assert 'aloha!'[0] == `a`
hello := 'Hello World 👋'
hello_runes := hello.runes()
assert hello_runes.string() == hello
}