tnfh.net
当前位置:首页 >> jAvA大写转小写 >>

jAvA大写转小写

public class Test3{ public static void main(String[] args){ String str="ABCabcVc"; char[] ch=str.toCharArray(); for(int i=0;i=65&&(int)ch[i]

1 大写转小写 String str = "ABC"; System.out.println(str.toLowerCase()); 2 小写转大写 String str = "abc"; System.out.println(str.toUpperCase());

public static void main(String[] args) { String str = "QAZWSXEDC"; String shuchu = ""; char[] arr = str.toCharArray(); for(int i = 0; i < arr.length; i++){ if(arr[i] % 2 == 0){ shuchu += arr[i]+"";} } System.out.println(shuchu....

toLowerCase(); //字符串转成小写 toUpperCase(); //字符串转成大写 String str = "abcABC"; String a = str.toLowerCase(); String b = str.toUpperCase(); System.out.println("a:"+a +"b:"+b); 输出结果a:abcabc b:ABCABC

//把一个字符串中的大写转为小写,小写转换为大写:思路1 public static String exChange(String str){ StringBuffer sb = new StringBuffer(); if(str!=null){ for(int i=0;i

//不需要弄那么麻烦 这样就行了 public static void main(String[] args) { String s=AHn9&nGJMm; for(int i=0;i

public class CharTest { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("请输入字母:"); char c = in.next().charAt(0); if (c >= 'A' && c = 'a' && c

import java.util.*; public class A { public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("请输入一个字母:"); String str=s.nextLine(); char c=str.charAt(0); char ch=Character.isUpperCase...

"ABC".toLowerCase(); //转小写 "abc".toUpperCase(); //转大写

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com