diff --git a/release_notes.md b/release_notes.md index 0e20cf130..213191fb1 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,4 +1,6 @@ ###In Development + - [#320](https://github.com/MehdiK/Humanizer/pull/320): Fixed Dehumanize actually humanizing an already dehumanized string + [Commits](https://github.com/MehdiK/Humanizer/compare/v1.28.0...master) ###v1.28.0 - 2014-07-06 diff --git a/src/Humanizer.Tests/StringDehumanizeTests.cs b/src/Humanizer.Tests/StringDehumanizeTests.cs index caaed20bd..9e5574d8b 100644 --- a/src/Humanizer.Tests/StringDehumanizeTests.cs +++ b/src/Humanizer.Tests/StringDehumanizeTests.cs @@ -10,6 +10,7 @@ public class StringDehumanizeTests [InlineData("Title Case Sentence Is Camelized", "TitleCaseSentenceIsCamelized")] [InlineData("Mixed case sentence Is Camelized", "MixedCaseSentenceIsCamelized")] [InlineData("lower case sentence is camelized", "LowerCaseSentenceIsCamelized")] + [InlineData("AlreadyDehumanizedStringIsUntouched", "AlreadyDehumanizedStringIsUntouched")] [InlineData("", "")] public void CanDehumanizeIntoAPascalCaseWord(string input, string expectedResult) { diff --git a/src/Humanizer/StringDehumanizeExtensions.cs b/src/Humanizer/StringDehumanizeExtensions.cs index 64c485d6d..53998dd4a 100644 --- a/src/Humanizer/StringDehumanizeExtensions.cs +++ b/src/Humanizer/StringDehumanizeExtensions.cs @@ -18,7 +18,7 @@ public static string Dehumanize(this string input) (from word in input.Split(' ') select word.Humanize(LetterCasing.Title)); - return string.Join("", titlizedWords); + return string.Join("", titlizedWords).Replace(" ", ""); } } }