码迷,mamicode.com
首页 > 其他好文 > 详细

String的replace方法

时间:2018-03-03 20:26:42      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:ring   返回   color   ati   pre   sys   style   返回值   print   

public class Test {
    public static void main(String args[]) {
        String Str = new String("hello");

        System.out.print("返回值 :" );
        System.out.println(Str.replace(‘o‘, ‘T‘));

        System.out.print("返回值 :" );
        System.out.println(Str.replace(‘l‘, ‘D‘));
    }
}
返回值 :hellT
返回值 :heDDo

 

String的replace方法

标签:ring   返回   color   ati   pre   sys   style   返回值   print   

原文地址:https://www.cnblogs.com/lay2017/p/8502718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!