Contoh tentang: Mendapatkan substring setelah kejadian pertama pemisah di java

public class Demo {
   public static void main(String[] args) {
      String str = "Tom-Hanks";
      String separator ="-";
      int sepPos = str.indexOf(separator);
      if (sepPos == -1) {
         System.out.println("");
      }
      System.out.println("Substring after separator = "+str.substring(sepPos +       separator.length()));
   }
}
The Leader