Simple Java programs for text manipulation