我正在使用 javascript 并想转换为 VB.NET。该代码是关于检查天气括号余额或不在给定字符串中的。
var ncount = 1
var str = "hello(world)"
if (ncount != 0) {
ncount = ncount - 1
//Using for loop to search each char in string
for (???) {
if (//If open parentheses is found)
ncount++;
else if (//If close parentheses is found)
ncount--;
else
//parentheses not balance
}
}else {
// Parentheses balanced
}