StringExtensions.cs refactiring