Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String formatPhone(String number) {
        StringBuffer sb = new StringBuffer();
        char c;
        for (int i = 0; i < number.length(); i++) {
            c = number.charAt(i);
            if (48 <= c && c <= 57)
                sb.append(c);
        }
        return sb.toString();
    }
}