I need to write a short recursive program for a class that checks if a string - t is transformation of another string - s. It simply needs to check if every character in s is also in t. For ex:
"sddbs" is not a transformation of "sdb"
"sddbs" is a transformation of "sddb".
public static boolean isTrans (String s, String t)
{
if (t.indexOf(s.charAt(0)) != -1)
return true;
else
return false;
return isTrans(s.substring(1), t);
}
And still.. the code doesn't work as expected. "unreachable statement" in the last line of the code.