Darano

regex-str-rplc

Dec 27th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.  public static void main(String[] args) {
  2.         String strTest = "the fb-group phpandjava the devs is the crap because the they have banned my the main account because the i reported ~15 posts as the spam";
  3.         System.out.println("Before: "+strTest);
  4.         String regex = "\\s*\\bthe\\b";
  5.         strTest = strTest.replaceAll(regex, "");
  6.         System.out.println("After: "+strTest);
  7.     }
Advertisement
Add Comment
Please, Sign In to add comment