toLowerCase()把字符變爲小寫 ,toUpperCase()把字符變爲大寫

String java.lang.String.toLowerCase()

toLowerCase 方法返回一個字符串,該字符串中的字母被轉換爲小寫字母。

strVariable.toLowerCase( )

"String Literal".toLowerCase( )

說明 toLowerCase 方法對非字母字符不會產生影響。

下面的示例演示了 of the toLowerCase 方法的效果:

var strVariable = "This is a STRING object"; strVariable = strVariable.toLowerCase( ); 在執行上一條語句後 strVariable 的值爲:

this is a string object


toUpperCase()把字符變爲大寫

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章