Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
4
Task/String-length/Java/string-length-1.java
Normal file
4
Task/String-length/Java/string-length-1.java
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
String s = "Hello, world!";
|
||||
int byteCountUTF16 = s.getBytes("UTF-16").length; // Incorrect: it yields 28 (that is with the BOM)
|
||||
int byteCountUTF16LE = s.getBytes("UTF-16LE").length; // Correct: it yields 26
|
||||
int byteCountUTF8 = s.getBytes("UTF-8").length; // yields 13
|
||||
Loading…
Add table
Add a link
Reference in a new issue