I want to get a specific set of characters after a substring:
My substring is:
"Element:Neo"
The set of characters I want are : Neo
Solutions I have tried:
String descriptions = "Element:Neo";
String checker = descriptions.substring(descriptions.indexOf("Element:")+1);
System.out.println(checker);
but I got my print statement as: lement:Neo
, instead of the desired Neo
So is it possible to use indexof
and get just Neo
Links I followed: how to find before and after sub-string in a string - but the given solution, didn't help me, hence I asked the question.