首页 > 编程语言 > 详细

Java charAt() 方法

时间:2018-11-15 22:10:34      阅读:149      评论:0      收藏:0      [点我收藏+]

charAt() 方法用于返回指定索引处的字符。索引范围为从 0 到 length() - 1。

参数

  • index -- 字符的索引。

返回值

返回指定索引处的字符。

实例

public class Test {

    public static void main(String args[]) {
        String s = "www.runoob.com";
        char result = s.charAt(8);
        System.out.println(result);
    }
}

  

Java charAt() 方法

原文:https://www.cnblogs.com/max-hou/p/9965992.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!