I have a string/column something like this
String a = \"000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF\";
I want to create a subs
Apart from Regex issues in the code you provided, i found it less readable also.
Try following:
int f = a.indexOf(" "); int l = a.lastIndexOf("_"); a = a.substring(0,f+1) + a.substring(l+1, a.length);