Answers for "string length in android studio"

0

string length in android studio

text = et.getText().toString();
if (text == null || text.length() < 3 || text.length > 8) {
    tv.setText("Invalid length, should be from 3 to 8 characters. Please check your code");
} else {
    a = text.substring(0,1);
    b = text.substring(1,2);

    c = text.substring(3,4);
    if (text.length() > 3) {
      d = text.substring(4);
    } else {
         d = null;
    }
}
Posted by: Guest on January-13-2021

Code answers related to "string length in android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language