Function to cutoff string based on word count.