diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6bac0..a21b20a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] +### Fixed + +- Fix issue #2: get rid of `java.lang.String.stripLeading` to get backward compatibility with JDK 1.8 + ## 0.2.2 - 2020-09-29 ### Fixed diff --git a/src/main/java/fr/evidev/netbeans/caseconverter/converters/ToTitleCaseConverter.java b/src/main/java/fr/evidev/netbeans/caseconverter/converters/ToTitleCaseConverter.java index 3f77b0e..496af76 100644 --- a/src/main/java/fr/evidev/netbeans/caseconverter/converters/ToTitleCaseConverter.java +++ b/src/main/java/fr/evidev/netbeans/caseconverter/converters/ToTitleCaseConverter.java @@ -32,7 +32,8 @@ public String convert(String text) { String result = StringUtils.capitalizePattern(text, "[\\s_-]+[a-zA-Z]"); result = StringUtils.capitalizeFirstChar(result); result = StringUtils.prefixPatternWith(result, "[A-Z]", " "); - result = StringUtils.replaceDuplicatesWithUnique(result, "[\\s_-]+", " ").stripLeading(); + result = StringUtils.replaceDuplicatesWithUnique(result, "[\\s_-]+", " "); + result = StringUtils.stripLeadingPatternFrom(result, " "); return result; }