java - Get substring starting after a given string -
caused by: com.some.packge.mycustomexception: blah, blah, blah
how can sub-string of above string in such way blah blah part. tried below mycustomexception in substring.
mainstring.substring(mainstring.indexof("mycustomexception"));
you can this:
mainstring = mainstring.substring(mainstring.indexof("mycustomexception:") + "mycustomexception:".length());
you should check if string
contains mycustomexception:
before that.
Comments
Post a Comment