If closing bracket ' ] ' , pop elemment until ' [ ' opening bracket is not found in the character stack .
else if ( str [ i ] == ' ] ' ) { temp = " " ; count = 0 ; if ( integerstack . Count > 0 ) { count = integerstack . Peek ( ) ; integerstack . Pop ( ) ; } while ( stringstack . Count > 0 && stringstack . Peek ( ) != ' [ ' ) { temp = stringstack . Peek ( ) + temp ; stringstack . Pop ( ) ; } if ( stringstack . Count > 0 && stringstack . Peek ( ) == ' [ ' ) { stringstack . Pop ( ) ; }