check Phone, 11 digit long - Android Phone

Android examples for Phone:Phone Number

Description

check Phone, 11 digit long

Demo Code


//package com.java2s;

public class Main {

    public static boolean checkPhone(String phone) {
        if (phone == null || phone.isEmpty()) {
            return false;
        }//from w  w w .  j a v a 2 s  . c  o m
        if (phone.matches("\\d{11}")) {
            return true;
        }
        return false;
    }
}

Related Tutorials