package com.codegym.task.task22.task2203;
/*
Between tabs
*/
public class Solution {
public static String getPartOfString(String string) throws Exception {
int a, b, c;
String str = null;
if(string == null){ throw new StringTooShortException(); }
else{
a = string.indexOf("\t");
b = string.lastIndexOf("\t");
}
if(a == b) {
throw new StringTooShortException();
}else{
c = string.indexOf("\t", a+1);
str = string.substring(a, c);
}
return str.trim();
}
public static class StringTooShortException extends Exception {
}
public static void main(String[] args) throws Exception {
System.out.println(getPartOfString("\tCodeGym is the best place \tto learn Java\t."));
}
}