Could someone explain what's wrong with this .....!???
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();}
if (!string.contains("\\t")) {
throw new StringTooShortException();}
else{
int v = string.indexOf("\\t");
int u = string.indexOf("\\t",v+1);
if(u!=-1)
return string.substring(v+1,u);
else
throw new StringTooShortException();
}
}
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."));
}
}