class Example {
    public static void main(String[] args) throws Exception {
        String s = "admin\0\0\0\0\0\0\0";
        
        System.out.println(s);
        System.out.println(s.length());
        
        s = s.replaceAll(new String(new byte[] {0}, "UTF-8"), "");
        System.out.println(s.length());
    }

    static {
        Thread.currentThread()
            .setUncaughtExceptionHandler((t, e) ->
                e.printStackTrace(System.out));
    }
}