Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import javax.annotation.Nonnull;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    @Nonnull
    public static String stripComments(@Nonnull String source) {
        Pattern pattern = Pattern.compile("#(.*)");
        Matcher matcher = pattern.matcher(source);
        return matcher.replaceAll("");
    }
}