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

前端 未结 4 1664
佛祖请我去吃肉
佛祖请我去吃肉 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:15

    To answer your questions in a easy way:

        a) String.length();
        b) String.charAt(/* String index */);
    

提交回复
热议问题