Implemented the native CharSequence version of toCharArray
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1089724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d1b24a3fea
commit
cc3b4d31bc
|
@ -6489,8 +6489,12 @@ public class StringUtils {
|
|||
if (cs instanceof String) {
|
||||
return ((String) cs).toCharArray();
|
||||
} else {
|
||||
// TODO: Implement rather than convert to String
|
||||
return cs.toString().toCharArray();
|
||||
int sz = cs.length();
|
||||
char[] array = new char[cs.length()];
|
||||
for (int i=0; i < sz; i++) {
|
||||
array[i] = cs.charAt(i);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue