Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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]
Comment

PREVIOUS NEXT
Code Example
Java :: button onclick java 
Java :: room library android 
Java :: java actionperformed 
Java :: get array element java 
Java :: how to set context path in spring boot 
Java :: important features of java programming language 
Java :: print statement in java 
Java :: what is whitespace in java 
Java :: how to change the character of a string in java 
Java :: java node class 
Java :: how to check if a person pressed a buuton in jframe 
Java :: smart ways to print a matrix in java 
Java :: How to efficiently find the start node of a loop within a singly linked list, in Java? 
Java :: Employee Java. 
Java :: rock paper scissors java 
Java :: mockito method called 
Java :: java queue implementation 
Java :: write message in file java 
Java :: what is static setter and getter examples in java 
Java :: 2 decimal places print format JAVA 
Java :: how to create hashmap 
Java :: Infinite While Loop Java Example 
Java :: java static variable 
Java :: How to merge two sorted arrays? 
Java :: java return new instance of generic type 
Java :: stream.concat 
Java :: quebra de linha java 
Java :: thread priorities in java 
Java :: java bogosort 
Java :: binary tree level traversal 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =