Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class enam
- {
- public static void main(String[] args)
- {
- String str1 = "Teknik Informatika Istitut Tekologi Sepuluh Nopember";
- System.out.println(str1.indexOf("Informatika"));
- System.out.println(str1.indexOf("Informatika",10));
- System.out.println(str1.lastIndexOf("Matematika"));
- System.out.println(str1.lastIndexOf("Matematika",10));
- System.out.println(str1.lastIndexOf("Matematika",20));
- System.out.println(str1.indexOf(97));
- System.out.println(str1.indexOf(97,7));
- System.out.println(str1.lastIndexOf(97));
- System.out.println(str1.lastIndexOf(97,7));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement