get Text Trim from EditText - Android User Interface

Android examples for User Interface:EditText

Description

get Text Trim from EditText

Demo Code


//package com.java2s;
import android.widget.EditText;

public class Main {

    public static String getTextTrim(EditText et) {
        if (et == null)
            return null;
        return getText(et).trim();
    }//from  w  w  w.j a v a2s .co m

    public static String getText(EditText et) {
        if (et == null)
            return null;
        return et.getText().toString();
    }
}

Related Tutorials