Query about the trim() method in Java

前端 未结 2 974
孤城傲影
孤城傲影 2021-01-29 07:49

I asked a question earlier but met harsh criticism, so here I pose it again. Simpler, and rephrased to appeal to those who may have been concerned about the way I asked it befor

2条回答
  •  一生所求
    2021-01-29 07:56

    There must be a non-whitespace character in the source string. Add the following to your code and see what it prints.

    for (char ch : someString.toCharArray()) {
         System.out.print(Integer.toHexString(ch) + " ");
    }
    

提交回复
热议问题