StringExercices.cs refactored