我試圖轉換爲CharSequence []時不斷收到此錯誤。Android - 方法未定義
的方法指定者(CharSequence的[])是未定義String類型
這是我的代碼
CharSequence[] cs = abbrev.toArray(new CharSequence[abbrev.length()]);
的縮寫就是拆分句子變成它的第一個字符 (你好世界 - > HW)
String[] result = matches.toString().split("\\s+");
// The string we'll create
String abbrev = "";
// Loop over the results from the string splitting
for (int i = 0; i < result.length; i++){
// Grab the first character of this entry
char c = result[i].charAt(0);
// If its a number, add the whole number
if (c >= '0' && c <= '9'){
abbrev += result[i];
}
// If its not a number, just append the character
else{
abbrev += c;
}
}
任何想法?
感謝
什麼你不明白的非常明確的錯誤信息? – 2015-02-24 19:18:56