Answers for "how to java split with trailing empty strings"

0

how to strip spaces in java using split with other delimiters

String[] splitted = input. trim(). split("\\s*,\\s*");
Posted by: Guest on April-16-2021
0

java split string without removing

String string = "Hello-World";
String[] split = string.Replace("-", "#-").Split("#"); 
//# is added to the Splitpoint so we can split on #

Output:
split = [Hello, -World]
Posted by: Guest on July-09-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language