Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 75efbd79
authored
Dec 02, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
7fbfd2b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
src/main/java/cn/com/glsx/merchants/util/ListUtils.java
src/main/java/cn/com/glsx/merchants/util/ListUtils.java
0 → 100644
View file @
75efbd7
package
cn
.
com
.
glsx
.
merchants
.
util
;
import
com.glsx.plat.common.utils.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/8/5 13:38
*/
public
class
ListUtils
{
public
static
String
listToString
(
List
list
,
char
separator
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
sb
.
append
(
list
.
get
(
i
)).
append
(
separator
);
}
return
sb
.
toString
().
substring
(
0
,
sb
.
toString
().
length
()
-
1
);
}
public
static
List
<
Integer
>
stringToList
(
String
liststring
,
char
separator
)
{
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
liststring
))
{
String
[]
split
=
liststring
.
split
(
String
.
valueOf
(
separator
));
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
String
s
=
split
[
i
];
list
.
add
(
Integer
.
parseInt
(
s
));
}
}
return
list
;
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment