Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Return Primary Account Number with a space between each digit group.
     *
     * @param pan String
     * @return    String
     */
    public static String prettyPan(String pan) {
        return pan.replaceAll("(.{4}(?!$))", "$1 ").trim();
    }
}