以下實例使用了String toUpperCase() 方法將字串從小寫轉為大寫:
//StringToUpperCaseEmp.java 文件public class StringToUpperCaseEmp { public static void main(String[] args) { String str = "string abc touppercase "; String strUpper = str.toUpperCase(); System.out.println("Original String: " + str); System.out.println("String changed to upper case: " + strUpper); }}
Original String: string abc touppercase String changed to upper case: STRING ABC TOUPPERCASE
以上就是Java 實例- 字串小寫轉大寫的內容,更多相關內容請關注PHP中文網(www.php.cn)!