SyntaxFix
Write A Post
Hire A Developer
Questions
To avoid try catch, use:
String s = "some text here"; byte[] b = s.getBytes(StandardCharsets.UTF_8); System.out.println(b.length);