android 字串大小寫轉換

2021-10-21 23:50:09 字數 803 閱讀 5170

/**

* 將給定字串中給定的區域的字元轉換成小寫

* * @param str 給定字串中

* @param beginindex 開始索引(包括)

* @param endindex 結束索引(不包括)

* @return 新的字串

*/public static string tolowercase(string str, int beginindex, int endindex)

/** * 將給定字串中給定的區域的字元轉換成大寫

* * @param str 給定字串中

* @param beginindex 開始索引(包括)

* @param endindex 結束索引(不包括)

* @return 新的字串

*/public static string touppercase(string str, int beginindex, int endindex)

/** * 將給定字串的首字母轉為小寫

* * @param str 給定字串

* @return 新的字串

*/public static string firstlettertolowercase(string str)

/** * 將給定字串的首字母轉為大寫

* * @param str 給定字串

* @return 新的字串

*/public static string firstlettertouppercase(string str)

大小寫轉換 字串

time limit 1000ms memory limit 65536kb problem description 把乙個字串裡所有的大寫字母換成小寫字母,小寫字母換成大寫字母。其他字元保持不變。input 輸入為一行字串,其中不含空格。長度不超過80個字元。output 輸出轉換好的字串。exa...

std string 字串大小寫轉換

該問題歸結為std transform 函式的使用 函式原型 template class inputiterator,class outputiterator,class unaryoperator outputiterator transform inputiterator first1,inp...

字串大小寫轉換java

3.將字串 abcdeabcde 中的大寫字母都變成小寫,再都變成大寫,再將改變後的兩個字串拼接到一起。最後分別輸出這個字串的第乙個和最後乙個字元。可能使用到的方法 int codepointat int index char charat int index string touppercase ...