Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Scanner;
- public class Number {
- public static void main(String[] args) throws IOException {
- getFile();
- }
- public static void getFile() throws IOException {
- File input = new File("AlphabeticPhoneNumbers.txt");
- Scanner inputFile = new Scanner(input);
- while (inputFile.hasNext()) {
- Scanner slashScan = new Scanner(inputFile.nextLine());
- String line = inputFile.nextLine();
- slashScan.close();
- }
- inputFile.close();
- }
- public static char getPhoneNumber(String input){
- char c;
- int counter = 0;
- c = input.toLowerCase().charAt(0);
- if (c == 'F' || c == 'B' || c == 'C'){
- }
- return c;
- }// End of full_number function
- private static boolean isVaild(String input){
- String phoneNumber = input;
- int length = phoneNumber.length();
- char c;
- int counter = 0;
- if(length == 12 || length == 14){
- do{
- c = phoneNumber.charAt(counter);
- if(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '-'){
- counter ++;
- }
- else{
- return false;
- }
- }
- while (counter < length - 1);
- }else {
- return false;
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement