1class Sample{
2public static void main(String[] args) {
3 String s = "1110 001";
4 int index = -1;
5 for(int i = 0; i < s.length(); i++ ){
6 if(Character.isWhitespace(s.charAt(i))){
7 index = i;
8 break;
9 }
10 }
11
12 System.out.println("Required Index : " + index);
13}
14}