int openBracket = 0;
int closeBracket = 0;
ArrayList subs = new ArrayList();
//you'll want to use a loop here to check
//if there are no more matches
//gets indexes
openBracket = str.IndexOf("[", openBracket);
closeBracket = str.IndexOf("]", openBracket);
//add substring
//i think you need the + 1 to include the ']'
subs.add(str.substring(openBracket, closeBracket - openBracket + 1));
//resets position
openBracket = closeBracket;
Last edited by dickersonka; Sep 16th, 2008 at 11:50 am.
Reputation Points: 133
Solved Threads: 141
Veteran Poster
Offline 1,162 posts
since Aug 2008