Snippet 1
str.index(sub[, start[, end]] )
Snippet 2
// Initialising String
String gfg = new String("Welcome to geeksforgeeks");
System.out.print("Found g first at position : ");
// Initial index of 'g' will print
// prints 11
System.out.println(gfg.indexOf('g'));
Similar Snippets
Creating Java Main Method Code Example – java
Find Duplicates In Arraylist Java Code Example – java
Java Creat A Folder Code Example – java
Copyright © Code Fetcher 2020