1

I have a string blah-*-bleh-*-bloh and I want to split it by -*- so I tried (amongst other things):

res.split("/-\\*-/g");

But it's not working. Anyone has an idea?

1 Answer 1

3

In java, there is no need for / before and /g after:

String[] splittedArray = res.split("-\\*-");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.