how to split string b r n r n remove code example
Example: 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]