java - Find position of substring within string with conditions -
given string
string foo = "if (bar = 10 ) { if (foobar == 1) { } }"
i want find position of "if" not have "if" within opening , closing braces. example above, want know position of second "if" not first "if".
i know have use form of regex new regex , not sure how go it. accept non regex answer.
Comments
Post a Comment