bogolyubskiyalexey

Get log type or empty string

Apr 25th, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1.     public static String getLogType(final String line) {
  2.         String[] splited = line.split("\\s+");
  3.         if (splited.length < 3) {
  4.             return "";
  5.         }
  6.         if (!isDateValid(splited[0] + " " + splited[1])) {
  7.             return "";
  8.         }
  9.         return splited[2];
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment