You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
349 B
Java
11 lines
349 B
Java
5 years ago
|
public class SearchStringEmp {
|
||
|
public static void main(String[] args) {
|
||
|
String strOrig = "Hello readers";
|
||
|
int intIndex = strOrig.indexOf("Hello");
|
||
|
if(intIndex == - 1) {
|
||
|
System.out.println("Hello not found");
|
||
|
} else {
|
||
|
System.out.println("Found Hello at index "+ intIndex);
|
||
|
}
|
||
|
}
|
||
|
}
|