diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8fe5f43cf..11f519480 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,7 @@ + Use non-ASCII digits in Javadoc examples for StringUtils.isNumeric Change min/max methods in NumberUtils/IEEE754rUtils from array input parameters to varargs Add fuzzy String matching logic to StringUtils Add wrap (with String or char) to StringUtils diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index ba97d6d17..4a1e136f2 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -6017,6 +6017,7 @@ public class StringUtils { * StringUtils.isNumeric("") = false * StringUtils.isNumeric(" ") = false * StringUtils.isNumeric("123") = true + * StringUtils.isNumeric("\u0967\u0968\u0969") = true * StringUtils.isNumeric("12 3") = false * StringUtils.isNumeric("ab2c") = false * StringUtils.isNumeric("12-3") = false @@ -6057,6 +6058,8 @@ public class StringUtils { * StringUtils.isNumericSpace(" ") = true * StringUtils.isNumericSpace("123") = true * StringUtils.isNumericSpace("12 3") = true + * StringUtils.isNumeric("\u0967\u0968\u0969") = true + * StringUtils.isNumeric("\u0967\u0968 \u0969") = true * StringUtils.isNumericSpace("ab2c") = false * StringUtils.isNumericSpace("12-3") = false * StringUtils.isNumericSpace("12.3") = false diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsIsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsIsTest.java index 73b031caa..057aa76fe 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsIsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsIsTest.java @@ -143,6 +143,8 @@ public class StringUtilsIsTest { assertFalse(StringUtils.isNumeric("ham kso")); assertTrue(StringUtils.isNumeric("1")); assertTrue(StringUtils.isNumeric("1000")); + assertTrue(StringUtils.isNumeric("\u0967\u0968\u0969")); + assertFalse(StringUtils.isNumeric("\u0967\u0968 \u0969")); assertFalse(StringUtils.isNumeric("2.3")); assertFalse(StringUtils.isNumeric("10 00")); assertFalse(StringUtils.isNumeric("hkHKHik6iUGHKJgU7tUJgKJGI87GIkug")); @@ -165,6 +167,8 @@ public class StringUtilsIsTest { assertTrue(StringUtils.isNumericSpace("1000")); assertFalse(StringUtils.isNumericSpace("2.3")); assertTrue(StringUtils.isNumericSpace("10 00")); + assertTrue(StringUtils.isNumericSpace("\u0967\u0968\u0969")); + assertTrue(StringUtils.isNumericSpace("\u0967\u0968 \u0969")); assertFalse(StringUtils.isNumericSpace("hkHKHik6iUGHKJgU7tUJgKJGI87GIkug")); assertFalse(StringUtils.isNumericSpace("_")); assertFalse(StringUtils.isNumericSpace("hkHKHik*khbkuh"));