Java examples for java.lang:String Markdown
remove Header markdown
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static String removeHeader(String brief) { String pString = "(\\#)(.*)"; Pattern pattern = Pattern.compile(pString, Pattern.MULTILINE); Matcher matcher = pattern.matcher(brief); while (matcher.find()) { String line = matcher.group(0); line = line.replace("#", ""); brief = brief.replace(matcher.group(0), line); }/*from w w w. j a v a2 s. c om*/ return brief; } }