2-8编程练习

2-8编程练习

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class StringDemo {
 
    public static void main(String[] args) {
        /*已知字符串"abcdefg",使之经过处理得到字符串"CDE",并进一步
            将“DE”替换为“MM”,得到结果:CMM */
        String str = "abcdefg"
        String str1 = str.substring(25);
        String str2 = str1.toUpperCase();
        System.out.println(str2);
        String str3 = str2.replaceAll("DE""MM");
        System.out.println(str3);
    }
 
}


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好,练习题完成的不错,很棒,继续加油

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码