-1
有沒有一種方法來轉換一個字符串(或爲CharSequence爲大寫的一部分?如何將String或CharSequence的一部分轉換爲大寫?
理想的情況下產生以下行爲的方法。
String hello = "hello";
System.out.println(hello.toUpperCase(0,3);
//Output: HEL
我知道toUpperCase(的),但我只想要大寫字符串的一部分。
很簡單,自己編寫這樣的功能。 –
看看'子串' – Reimeus
只需要將substring()和'toUpperCase()' – schwobaseggl