Search code examples
javaandroidandroid-edittext

Android edittext check white space


How can I check white space in edittext if edittext is white space only return null but I don't want to disable white space cause some time user use "firstname lastname" I try to check like feature change name in application Line


Solution

  •    EditText et_username=(EditText)findViewById(R.id.et_username);
        if(et_username.getText().toString().trim().length()==0)
        {
    
        }