1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # This file is free software, which comes along with NIT. This software is
4 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6 # PARTICULAR PURPOSE. You can modify it is you want, provided this header
7 # is kept unaltered, and a notification of the changes is added.
8 # You are allowed to redistribute it and sell it, alone or is a part of
12 intrude import string_experimentations
::utf8
14 var s
= "aΓ γπ".as(FlatString)
15 assert s
.index
[0].code_point
== 97
16 assert s
.index
[1].code_point
== 224
17 assert s
.index
[2].code_point
== 12495
18 assert s
.index
[3].code_point
== 66374
20 var str
= "γaγΠγΌπaδΈη α . α A,π aζ₯ζ¬Aθͺaγ§γ".as(FlatString)
30 var x
= str
.substring
(4,4).as(FlatString)
34 for i
in [0..x
.length
[ do
35 print x
.index
[i
+ x
.index_from
].code_point
.to_hex