split a string in java without split 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]