I am trying to parse data from the []
in a String
in java
String text = "some text [Karan] some text";
I want to the computer to read
Karan
present inside the brackets
I have tried String.split()
method but it packs it into an array which I don't want.
Is there any way to do this. Thank you