Getting the right output..Not veryfying.Can someone lookthrough please?
package com.codegym.task.task22.task2202;
/*
Find a substring
*/
public class Solution {
public static void main(String[] args)
{
System.out.println(getPartOfString("CodeGym is the best place to learn Java."));
}
public static String getPartOfString(String string)
{
if (string == null)
throw new StringTooShortException();
String[] s1 = string.split(" ");
if (s1.length < 5)
throw new StringTooShortException();
String s = "";
s = string.substring(8,25);
return s;
}
public static class StringTooShortException extends RuntimeException
{
}
}