C#括号配对
C#括号配对public int findClosingParen(char[] text, int openPos) {
int closePos = openPos;
int counter = 1;
while (counter > 0) {
char c = text[++closePos];
if (c == '(') {
counter++;
}
else if (c == ')') {
counter--;
}
}
return closePos;
}
参考:
【1】https://blog.csdn.net/lanazyit/article/details/109443666
【2】https://blog.csdn.net/qq_45063234/article/details/106761013
【3】https://www.codingdict.com/questions/94598
页:
[1]