Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Application {
- public static void main(String[] args)
- {
- }
- {
- String hi = "Hello";
- System.out.println(hi.length());
- System.out.println("Hello".length());
- System.out.println(hi.substring(1));
- System.out.println(hi.substring(1,3));
- System.out.println(hi.substring(3,4));
- System.out.println(hi.substring(1,8));
- String alpha = "abc";
- System.out.println(alpha.substring(1,3).equals("bc"));
- System.out.println(alpha.substring(1,3).equals("Bc"));
- System.out.println(hi.substring(0,1).equals(hi.charAt(0)));
- String day = "Tomorrow";
- System.out.println(day.toUpperCase().toLowerCase());
- System.out.println(hi.indexOf("H"));
- System.out.println(hi.indexOf("h"));
- System.out.println(hi.indexOf('H'));
- System.out.println(hi.indexOf('h'));
- System.out.println(day.indexOf("o"));
- System.out.println(day.lastIndexOf("o"));
- System.out.println(day.lastIndexOf("o",3));
- System.out.println(day.isEmpty());
- String empty = "";
- System.out.println(empty.isEmpty());
- }
- }
Add Comment
Please, Sign In to add comment