in reply to print only uppercase sentences

A regular expression should do the trick; but since there is more than one way to do it (TIMTOWTDI), I would point out that the use of uc as noted by a previous poster provides another way to confirm the letters in the string are all uppercase.

If that's too vague, perhaps a peek at your code will help focus things nicely. :-)