Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Validates the user full name.
     * @param fullname - User full name.
     * @return - True (if is valid) or False (otherwise).
     */
    public static boolean validateFullName(String fullname) {
        if (fullname == null || !fullname.matches("^[A-Za-z]{3,}(\\s[A-Za-z]+[\\.]{0,1})+[ ]*"))
            return false;

        return true;
    }
}