How to check how many letters are in a string in java?

前端 未结 4 1659
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 18:03

How do you check how many letters are in a Java string?

How do you check what letter is in a certain position in the string (i.e, the second letter of the string)?

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 18:24

    1) To answer your question:

      String s="Java";
      System.out.println(s.length()); 
    

提交回复
热议问题