displaying substring of specified length