TonyTroev

ToUpperCase

Apr 6th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.util.regex.Pattern;
  5.  
  6. public class ToUpperCase {
  7.     public static void main(String[] args) throws IOException {
  8.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  9.         String text = reader.readLine();
  10.  
  11.        text = Pattern.compile("<upcase>(.+?)</upcase>").matcher(text).replaceAll(matchResult -> matchResult.group(1).toUpperCase());
  12.         System.out.println(text);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment