当前位置: 技术问答>java相关
开发中遇到两个小问题,望大家能尽快帮忙
来源: 互联网 发布时间:2015-03-23
本文导语: 一,在双引号中如何表示双引号,比如现在有一字符串ascd"ddd"dsd,如何赋给变量? 二,如何把一字符串首字母由大写转化成小写?比如String m="Java";如何把m变量变成"java"? | toLowerCase public String toLowerCa...
一,在双引号中如何表示双引号,比如现在有一字符串ascd"ddd"dsd,如何赋给变量?
二,如何把一字符串首字母由大写转化成小写?比如String m="Java";如何把m变量变成"java"?
二,如何把一字符串首字母由大写转化成小写?比如String m="Java";如何把m变量变成"java"?
|
toLowerCase
public String toLowerCase()
Converts all of the characters in this String to lower case using the rules of the default locale. This is equivalent to calling toLowerCase(Locale.getDefault()).
toUpperCase
public String toUpperCase()
Converts all of the characters in this String to upper case using the rules of the default locale. This method is equivalent to toUpperCase(Locale.getDefault()).
public String toLowerCase()
Converts all of the characters in this String to lower case using the rules of the default locale. This is equivalent to calling toLowerCase(Locale.getDefault()).
toUpperCase
public String toUpperCase()
Converts all of the characters in this String to upper case using the rules of the default locale. This method is equivalent to toUpperCase(Locale.getDefault()).
|
ascd"ddd"dsd ascd"ddd"dsd
String m="Java";
m = m.toLowerCase();
String m="Java";
m = m.toLowerCase();
|
1.用"..."..."
2.String类型有toLowerCase()和toUpperCase()方法
2.String类型有toLowerCase()和toUpperCase()方法
|