Update main.c

Changes made to sub string method.