I have a string like
abababa:nsndnfnng.leleelld_kdjdh
I want to split it on ":" and ".", so that I get a list as follows:
{abababa, nsndnfnng, eleelld_kdjdh}
how can I do this with calling the split() once?
You are looking for String#split
method. Since it accepts regex which will describe delimiter your code could look like
String[] result = yourString.split("[:.]");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With