Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. var input = "My phone is 1234567890 and my office is 7894561230";
  2.  
  3. var output = "My phone is <u>1234567890</u> and my office is <u>7894561230</u>";
  4.  
  5. String input = "My phone is 1234567890 and my office is 7894561230";
  6. String regex = "\d{4,}";
  7. String output = input.replaceAll(regex, "<u>$0</u>");
  8. System.out.println(output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement