@Test public void testStripComments() { Assert.assertEquals("", TextUtils.stripComments("#world")); Assert.assertEquals("hello", TextUtils.stripComments("hello#world")); Assert.assertEquals("multi\nline", TextUtils.stripComments("multi#hello world\nline#world")); }
@Nonnull public static String stripComments(@Nonnull String source) { Pattern pattern = Pattern.compile("#(.*)"); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); }
TextUtils { @Nonnull public static String stripComments(@Nonnull String source) { Pattern pattern = Pattern.compile("#(.*)"); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); } }
TextUtils { @Nonnull public static String stripComments(@Nonnull String source) { Pattern pattern = Pattern.compile("#(.*)"); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); }  }
TextUtils { @Nonnull public static String stripComments(@Nonnull String source) { Pattern pattern = Pattern.compile("#(.*)"); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); }  @Nonnull static String normalizeNewlines(@Nonnull String source); @Nonnull static String normalizeNewlines(@Nonnull String source, String newlineValue); @Nonnull static String normalizeWhitespace(@Nonnull String source); @Nonnull static String stripComments(@Nonnull String source); }
TextUtils { @Nonnull public static String stripComments(@Nonnull String source) { Pattern pattern = Pattern.compile("#(.*)"); Matcher matcher = pattern.matcher(source); return matcher.replaceAll(""); }  @Nonnull static String normalizeNewlines(@Nonnull String source); @Nonnull static String normalizeNewlines(@Nonnull String source, String newlineValue); @Nonnull static String normalizeWhitespace(@Nonnull String source); @Nonnull static String stripComments(@Nonnull String source);  }