Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.regex.*;

public class Main {

    public static StringBuffer removePatternContents(String defStr, Pattern pat) {
        Matcher mat = pat.matcher(defStr);
        StringBuffer sb = new StringBuffer();
        while (mat.find()) {
            mat.appendReplacement(sb, " ");
        }
        mat.appendTail(sb);
        return sb;
    }
}