Any ideas what's wrong with this code?
package com.codegym.task.task22.task2203;
/*
Between tabs
*/
public class Solution {
public static String getPartOfString(String string) throws StringTooShortException {
if(string == null) throw new StringTooShortException();
String[] strings = string.split(" ");
int tabCounter = 0;
for (int i = 0; i < strings.length; i++) {
if(strings[i].contains("\t")){
tabCounter++;
}
}
if(tabCounter <= 2){
throw new StringTooShortException();
}
int i = string.indexOf("\t");
int i1 = string.indexOf("\t", 1);
String substring = string.substring(i, i1).trim();
return substring;
}
public static class StringTooShortException extends Exception {
}
public static void main(String[] args) throws StringTooShortException {
System.out.println(getPartOfString("\tCodeGym is the best place \tto learn Java\t."));
}
}