package cn.zxj.com;/* 将"goOd gooD stUdy dAy dAy up", 每个单词的首字母转换成大写其余都是小写字母 (不许直接输出Good Good Study Day Day Up 要用代码实现)?*/ class Test {public static void main(String[] args){String s = "goOd gooD stUdy dAy dAy up";String[] sArr = s.split(" ");String ns = "";for(int i = 0;i<sArr.length;i++){String substring1 = sArr[i].substring(0, 1).toUpperCase();String substring2 = sArr[i].substring(1).toLowerCase();String k = " ";if(i==sArr.length-1){k="";}ns+=(substring1+substring2+k);}System.out.println(s);System.out.println(s.length());System.out.println(ns);System.out.println(ns.length());} }
详细解决方案
将“goOd gooD stUdy dAy dAy up“,每个单词的首字母转换成大写其余都是小写字母(不许直接输出Good Good Study Day Day Up 要用代码实现)?
热度:26 发布时间:2023-11-06 14:23:55.0
相关解决方案
- Did you know a software for study english?该怎么解决
- It's difficult to find a good job!解决方案
- Good morning, my every good friends,let's see "hello" to eachother!该怎么处理
- 每日背熟一句英语(12)It's definitely pathtic that I still can't speak good English with.
- 每日背熟一句英语(17)How are you coming along with your study of English
- 每天背熟一句英语(17)How are you coming along with your study of English?解决方案
- Did you know a software for study english?解决方法
- 每天背熟一句英语(12)It's definitely pathtic that I still can't speak good English with.解决办法
- use it in good health是什么意思?解决方法
- Good morning, my every good friends,let's see "hello" to eachother!解决方案
- Codeforces Round #166 (Div. 二) D - Good Substrings
- [推荐]进程调度源代码(GOOD)
- [推荐]进程调度源代码(GOOD)
- asp study.asp?page=2&s_type=<%=rs("s_type")%> 有关问题?
- [网络分析]WEBQQ3.0协议分析-good good study
- JavaScript:The Good Parts(5)
- JavaScript: The Good Parts 读书笔记(1)
- JavaScript: The Good Parts 读书笔记(3)
- JavaScript: The Good Parts 读书笔记(2)
- JavaScript: The Good Parts 读书笔记(4)
- JavaScript: The Good Parts 读书笔记(5)
- JS regular expression examples from <<good parts>>
- jquery.ui.draggable汉语言文档jquery 自由拖拽类~study
- JavaScript:The Good Parts (4)
- 怎么判断输入的字符串有多少种类型(数字,大,小写字母,特殊符号)
- 随机送,Good Luck,该怎么解决
- 【Android Study】怎的更“高端”地建立分割符
- phpmyadmin汉语显示数字+小写字母,和普遍的乱码不通
- @@XP Good Bye@@解决思路
- Did you know a software for study english?该怎么处理