Monty374

String Demo

Oct 5th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. package string.demo;
  2.  
  3. import java.lang.String;
  4.  
  5. public class StringDemo {
  6.  
  7. public static void main(String[] args) {
  8. String text = " May The Force Be With You. ";
  9. int length;
  10.  
  11. System.out.print(text + "\n\n");
  12.  
  13. text = text.trim();
  14. System.out.print(text + "\n\n");
  15.  
  16. text = text.toLowerCase();
  17. System.out.print(text + "\n\n");
  18.  
  19. text = text.toUpperCase();
  20. System.out.print(text + "\n\n");
  21.  
  22. length = text.length();
  23. System.out.print(length + "\n\n");
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment