|
|
@ -14,9 +14,17 @@ public class EditTextHelper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static char[] getEditTextChars(EditText text) {
|
|
|
|
public static char[] getEditTextChars(EditText text) {
|
|
|
|
Editable editable = text.getText();
|
|
|
|
return getEditTextChars(text, false);
|
|
|
|
char[] chars = new char[editable.length()];
|
|
|
|
}
|
|
|
|
editable.getChars(0, editable.length(), chars, 0);
|
|
|
|
|
|
|
|
|
|
|
|
public static char[] getEditTextChars(EditText text, boolean removeSpaces) {
|
|
|
|
|
|
|
|
String editTextString = text.getText().toString();
|
|
|
|
|
|
|
|
if (removeSpaces) {
|
|
|
|
|
|
|
|
editTextString = editTextString.replaceAll("\\s","");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char[] chars = new char[editTextString.length()];
|
|
|
|
|
|
|
|
editTextString.getChars(0, editTextString.length(), chars, 0);
|
|
|
|
return chars;
|
|
|
|
return chars;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|