fork download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. List<String> strs = Arrays.asList("\n123 : other", "123 : other", "\n4 : smth", "123 : a");
  9. for (String str : strs)
  10. System.out.println("\"" + str.replaceFirst("\n[0-9]+\\s+:\\s*", "") + "\"");
  11.  
  12. }
  13. }
Success #stdin #stdout 0.11s 50836KB
stdin
Standard input is empty
stdout
"other"
"123 : other"
"smth"
"123 : a"