How to split a string into two considering end of the string with numbers (which is inside the squre brackets)

I need to split strings into two with a given separator using regex. Sample Strings and expected output as below testnames[3] ===> testnames,3 3alpha[0] ====> 3alpha, 0 beta[4]value[2] ===> …

Split fasta file into specific new fasta files

So I’m writing this code that will read a fasta file. In the fasta file, there will be 10 sequences. The start of the sequence will be “>” I want to split 50:50 of those sequences and …

How can I split a string without knowing the split characters a-priori?

For my project I have to read various input graphs. Unfortunately, the input edges have not the same format. Some of them are comma-separated, others are tab-separated, etc. For example: File 1: 123,…

How can I get a special part in a string in Java? [closed]

I have to read commands from a file I have and take necessary actions according to each command. I was able to find out the process of reading from the file and what the command is, but I am having …

Split a List of Lists with camel splitter

I have many ArrayLists created to hold the collections of separate entities to be split in to their own entities. these are added to an ArrayList then pushed to the exchange where I try to split the …

Java .split(“|”) not working

I just ran into the problem that the split method for strings wouldn’t work with character “|” as an argument. It somehow separates each character in the string. Code: String[] res = “12345|6”.split(…

How to convert comma-separated String to List?

Is there any built-in method in Java which allows us to convert comma separated String to some container (e.g array, List or Vector)? Or do I need to write custom code for that? String commaSeparated =…

How to split a string with any whitespace chars as delimiters

What regex pattern would need I to pass to java.lang.String.split() to split a String into an Array of substrings using all whitespace characters (‘ ‘, ‘t’, ‘n’, etc.) as delimiters?