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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -