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 sanitizeUserInput(String usrInput) {
        String lower = usrInput.toLowerCase();
        if (lower.replaceAll("[^a-z]", "").isEmpty()) {
            return "";
        }
        String alphabetic = lower.replaceAll("[^a-z ]", "");
        return alphabetic.replaceAll("[ ]", "+");
    }
}