Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jh-boot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Hrabal
jh-boot
Commits
d8a360f6
Commit
d8a360f6
authored
5 years ago
by
Jan Hrabal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strip accents
parent
ccaa3e2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Utils.java
src/main/java/com/jh/boot/utils/Utils.java
+9
-0
No files found.
src/main/java/com/jh/boot/utils/Utils.java
View file @
d8a360f6
...
...
@@ -2,6 +2,7 @@ package com.jh.boot.utils;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.Normalizer
;
import
java.util.Objects
;
import
org.springframework.util.StringUtils
;
...
...
@@ -260,5 +261,13 @@ public class Utils {
return
nullsFirst
&&
c1
==
null
?
-
1
:
1
;
}
public
static
String
normalize
(
String
s
)
{
if
(
s
==
null
)
{
return
null
;
}
s
=
Normalizer
.
normalize
(
s
,
Normalizer
.
Form
.
NFD
);
s
=
s
.
replaceAll
(
"[\\p{InCombiningDiacriticalMarks}]"
,
""
);
return
s
.
toLowerCase
();
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment