fun to print substring of string without loop or inbuilt lib