Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.text.TextUtils;

public class Main {

    public static boolean isPhoneNumberAvailable(String phoneNumber) {
        if (TextUtils.isEmpty(phoneNumber)) {
            return false;
        }
        if (phoneNumber.length() != 11 || !phoneNumber.substring(0, 1).equals("1") || phoneNumber.contains("*")
                || phoneNumber.contains("#")) {
            return false;
        } else {
            return true;
        }

    }
}