Added a template method to the StringManipulator class