Merge branch 'test' into feauture-20261104
# Conflicts: # bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcOrderBillMapper.java
This commit is contained in:
@@ -168,6 +168,35 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||
return (str == null ? "" : str.trim());
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize destination postcode for zone match / persist.
|
||||
* Removes all Unicode whitespace (incl. NBSP / U+2005) and ASCII spaces;
|
||||
* strips Excel-style trailing ".0" on pure digits.
|
||||
*/
|
||||
public static String normalizePostcode(String postcode)
|
||||
{
|
||||
if (isEmpty(postcode))
|
||||
{
|
||||
return postcode;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(postcode.length());
|
||||
for (int i = 0; i < postcode.length(); )
|
||||
{
|
||||
int cp = postcode.codePointAt(i);
|
||||
if (!Character.isWhitespace(cp))
|
||||
{
|
||||
sb.appendCodePoint(cp);
|
||||
}
|
||||
i += Character.charCount(cp);
|
||||
}
|
||||
String n = sb.toString();
|
||||
if (n.endsWith(".0") && n.matches("\\d+\\.0"))
|
||||
{
|
||||
return n.substring(0, n.length() - 2);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换指定字符串的指定区间内字符为"*"
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user