Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static String getOnlyNumerics(String input) {
        if (input == null)
            return null;

        StringBuilder strBuff = new StringBuilder();

        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);

            if (Character.isDigit(c))
                strBuff.append(c);
        }

        return strBuff.toString();
    }
}