mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
utf8: reverse() to handle unicode strings (#10133)
This commit is contained in:
parent
2086e6f1c1
commit
4974fd09e5
2 changed files with 22 additions and 0 deletions
|
@ -68,3 +68,10 @@ fn test_raw_indexing() {
|
|||
assert utf8.raw_index(a, 7) == 'g'
|
||||
assert utf8.raw_index(a, 8) == '!'
|
||||
}
|
||||
|
||||
fn test_reversed() {
|
||||
a := '我是V Lang!'
|
||||
b := '你好世界hello world'
|
||||
assert utf8.reverse(a) == '!gnaL V是我'
|
||||
assert utf8.reverse(b) == 'dlrow olleh界世好你'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue