fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. String s = " By 1889, central telephone exchange operators were known as 'hello-girls' due to the association between the greeting and the telephone ";
  14. int index=s.indexOf("'");
  15. String s1=s.substring(0,index);
  16. String s2=s.substring(index,s.length()-1);
  17. System.out.println(s1);
  18. System.out.println(s2);
  19.  
  20. }
  21. }
Success #stdin #stdout 0.09s 320320KB
stdin
Standard input is empty
stdout
 By 1889, central telephone exchange operators were known as 
'hello-girls' due to the association between the greeting and the telephone