Guest User

Untitled

a guest
Jul 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2. public class Application {
  3.  
  4. public static void main(String[] args)
  5. {
  6.  
  7. }
  8.  
  9.  
  10. {
  11. String hi = "Hello";
  12. System.out.println(hi.length());
  13.  
  14. System.out.println("Hello".length());
  15.  
  16. System.out.println(hi.substring(1));
  17.  
  18. System.out.println(hi.substring(1,3));
  19.  
  20. System.out.println(hi.substring(3,4));
  21.  
  22. System.out.println(hi.substring(1,8));
  23.  
  24. String alpha = "abc";
  25. System.out.println(alpha.substring(1,3).equals("bc"));
  26.  
  27. System.out.println(alpha.substring(1,3).equals("Bc"));
  28.  
  29. System.out.println(hi.substring(0,1).equals(hi.charAt(0)));
  30.  
  31. String day = "Tomorrow";
  32. System.out.println(day.toUpperCase().toLowerCase());
  33.  
  34. System.out.println(hi.indexOf("H"));
  35.  
  36. System.out.println(hi.indexOf("h"));
  37.  
  38. System.out.println(hi.indexOf('H'));
  39.  
  40. System.out.println(hi.indexOf('h'));
  41.  
  42. System.out.println(day.indexOf("o"));
  43.  
  44. System.out.println(day.lastIndexOf("o"));
  45.  
  46. System.out.println(day.lastIndexOf("o",3));
  47.  
  48. System.out.println(day.isEmpty());
  49.  
  50. String empty = "";
  51. System.out.println(empty.isEmpty());
  52. }
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. }
Add Comment
Please, Sign In to add comment