Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
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
曲欣亮
sap-service
Commits
80ff848d
Commit
80ff848d
authored
Jul 26, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
c9886ad7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
StringUtil.java
src/main/java/com/egolm/sso/util/StringUtil.java
+23
-21
No files found.
src/main/java/com/egolm/sso/util/StringUtil.java
View file @
80ff848d
...
...
@@ -14,22 +14,20 @@ import org.dom4j.Element;
public
class
StringUtil
{
public
static
Double
toDouble
(
String
value
)
{
Double
res
;
if
(
value
==
null
||
value
.
equals
(
""
))
{
res
=
0.0
;
}
else
{
res
=
Double
.
valueOf
(
value
);
if
(
value
==
null
||
value
.
equals
(
""
))
{
return
null
;
}
else
{
return
Double
.
valueOf
(
value
);
}
return
res
;
}
public
static
String
prependZero
(
int
Num
,
int
length
)
{
return
prependZero
(
Num
+
""
,
length
);
return
prependZero
(
Num
+
""
,
length
);
}
public
static
String
prependZero
(
String
Num
,
int
length
)
{
String
prepend
=
""
;
for
(
int
i
=
Num
.
length
();
i
<
length
;
i
++)
{
for
(
int
i
=
Num
.
length
();
i
<
length
;
i
++)
{
prepend
=
prepend
+
"0"
;
}
return
prepend
+
Num
;
...
...
@@ -59,7 +57,9 @@ public class StringUtil {
StringBuffer
sb
=
new
StringBuffer
(
""
);
for
(
int
i
=
0
;
i
<
strs
.
length
;
i
++)
{
String
str
=
String
.
valueOf
(
strs
[
i
]);
sb
.
append
((
i
==
0
&&
before
!=
null
)
?
before
:
""
).
append
(
str
==
null
?
""
:
str
).
append
(
i
<
strs
.
length
-
1
?
(
sign
==
null
?
""
:
sign
)
:
""
).
append
((
i
==
strs
.
length
-
1
&&
after
!=
null
)
?
after
:
""
);
sb
.
append
((
i
==
0
&&
before
!=
null
)
?
before
:
""
).
append
(
str
==
null
?
""
:
str
)
.
append
(
i
<
strs
.
length
-
1
?
(
sign
==
null
?
""
:
sign
)
:
""
)
.
append
((
i
==
strs
.
length
-
1
&&
after
!=
null
)
?
after
:
""
);
}
return
String
.
valueOf
(
sb
);
}
...
...
@@ -71,7 +71,9 @@ public class StringUtil {
}
else
{
StringBuffer
sb
=
new
StringBuffer
(
""
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
sb
.
append
(
i
==
0
&&
before
!=
null
?
before
:
""
).
append
(
str
).
append
(
i
<
count
-
1
?
(
sign
==
null
?
""
:
sign
)
:
""
).
append
(
i
==
count
-
1
&&
after
!=
null
?
after
:
""
);
sb
.
append
(
i
==
0
&&
before
!=
null
?
before
:
""
).
append
(
str
)
.
append
(
i
<
count
-
1
?
(
sign
==
null
?
""
:
sign
)
:
""
)
.
append
(
i
==
count
-
1
&&
after
!=
null
?
after
:
""
);
}
return
String
.
valueOf
(
sb
);
}
...
...
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