I want to convert the String to ArrayList, and I want to add a comma part

Asked 1 years ago, Updated 1 years ago, 77 views

Is there any method created in Java that separates the string into an array or list by comma? Or do I have to make the code myself?

string java collections split

2022-09-22 15:19

1 Answers

List<String> items = Arrays.asList(str.split("\\s*,\\s*")); If you do this, separate it into commas and put in strings.


2022-09-22 15:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.