Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * 
     * @param input
     * @param newDigit
     * @return
     */
    public static String formatInput(String input, int newDigit) {
        String output = input + Integer.toString(newDigit);
        int start = output.length() - 4;
        if (start < 0) {
            start = 0;
        }
        String format = output.substring(start, output.length());
        return format;
    }
}