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 {
    public static String checkAndChangeFileName(String sInput) {
        String CheckedAndChangedName = "";
        // sInput = sInput.toUpperCase();
        char[] cInput = sInput.toCharArray();

        for (int i = 0; i < sInput.length(); i++) {
            if (cInput[i] == '0' || cInput[i] == '1' || cInput[i] == '2' || cInput[i] == '3' || cInput[i] == '4'
                    || cInput[i] == '5' || cInput[i] == '6' || cInput[i] == '7' || cInput[i] == '8'
                    || cInput[i] == '9' || cInput[i] == 'a' || cInput[i] == 'b' || cInput[i] == 'c'
                    || cInput[i] == 'd' || cInput[i] == 'e' || cInput[i] == 'f' || cInput[i] == 'g'
                    || cInput[i] == 'h' || cInput[i] == 'i' || cInput[i] == 'j' || cInput[i] == 'k'
                    || cInput[i] == 'l' || cInput[i] == 'm' || cInput[i] == 'n' || cInput[i] == 'o'
                    || cInput[i] == 'p' || cInput[i] == 'q' || cInput[i] == 'r' || cInput[i] == 's'
                    || cInput[i] == 't' || cInput[i] == 'u' || cInput[i] == 'v' || cInput[i] == 'w'
                    || cInput[i] == 'x' || cInput[i] == 'y' || cInput[i] == 'z' || cInput[i] == 'A'
                    || cInput[i] == 'B' || cInput[i] == 'C' || cInput[i] == 'D' || cInput[i] == 'E'
                    || cInput[i] == 'F' || cInput[i] == 'G' || cInput[i] == 'H' || cInput[i] == 'I'
                    || cInput[i] == 'J' || cInput[i] == 'K' || cInput[i] == 'L' || cInput[i] == 'M'
                    || cInput[i] == 'N' || cInput[i] == 'O' || cInput[i] == 'P' || cInput[i] == 'Q'
                    || cInput[i] == 'R' || cInput[i] == 'S' || cInput[i] == 'T' || cInput[i] == 'U'
                    || cInput[i] == 'V' || cInput[i] == 'W' || cInput[i] == 'X' || cInput[i] == 'Y'
                    || cInput[i] == 'Z' || cInput[i] == '.' || cInput[i] == '_') {
                CheckedAndChangedName += cInput[i];
            }
        }
        return CheckedAndChangedName;
    }
}