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[]){
  11. String str1 = "Hello! Java World";
  12.  
  13. int index = str1.indexOf("Java");
  14. int size = "Java".length() ;
  15.  
  16. String str2 = str1.substring(index, index+size);
  17. str2 = str2.toLowerCase();
  18. str2 = str2.replace('a', 'A');
  19.  
  20. System.out.println(str2);
  21. }
  22. }
Success #stdin #stdout 0.06s 32280KB
stdin
Standard input is empty
stdout
jAvA