Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/String-length/Fantom/string-length-1.fantom
Normal file
14
Task/String-length/Fantom/string-length-1.fantom
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
fansh> c := "møøse"
|
||||
møøse
|
||||
fansh> c.toBuf.size // find the byte length of the string in default (UTF8) encoding
|
||||
7
|
||||
fansh> c.toBuf.toHex // display UTF8 representation
|
||||
6dc3b8c3b87365
|
||||
fansh> c.toBuf(Charset.utf16LE).size // byte length in UTF16 little-endian
|
||||
10
|
||||
fansh> c.toBuf(Charset.utf16LE).toHex // display as UTF16 little-endian
|
||||
6d00f800f80073006500
|
||||
fansh> c.toBuf(Charset.utf16BE).size // byte length in UTF16 big-endian
|
||||
10
|
||||
fansh> c.toBuf(Charset.utf16BE).toHex // display as UTF16 big-endian
|
||||
006d00f800f800730065
|
||||
4
Task/String-length/Fantom/string-length-2.fantom
Normal file
4
Task/String-length/Fantom/string-length-2.fantom
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fansh> c := "møøse"
|
||||
møøse
|
||||
fansh> c.size
|
||||
5
|
||||
Loading…
Add table
Add a link
Reference in a new issue