runes.v implemented
This commit is contained in:
parent
2dc091356d
commit
3e9479f7cf
|
|
@ -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
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue