#16 Java format Unicode encoder/decoder
We need a reusable program to encode/decode text to unicode value as represented in Java and vice-versa.
Encoder:
Input
"hola"
Output
"\u0068\u006f\u006c\u0061"
Decoder:
Input
"\u0068\u006f\u006c\u0061"
Output
"hola"
Observations:
Please note that unicode values have always a back slash \ the letter u and 4 hexadecimal digits corresponding to the value in the unicode character set.
Codewars has some trouble showing non ASCII characters so perhaps you should try it locally first.
'매일매일개발 > Codewars' 카테고리의 다른 글
codewars #18 Convert string to camel case (5kyu) (1) | 2018.04.10 |
---|---|
codewars #17 Strings Mix (4kyu) (0) | 2018.04.09 |
Codewars #15 Bagels (4kyu) (0) | 2018.04.06 |
Codewars #14 Calculator (3kyu) (0) | 2018.04.03 |
Codewars #13 Anagram Detection (7kyu) (0) | 2018.04.02 |