Grasshopper API
GH_ExpressionParserBalancedCharTest Method |
Test a string for balanced open and close chars. You can use this function to
see if brackets or parenthesis have been properly used.
Namespace: Grasshopper.Kernel.Expressions
Assembly: Grasshopper (in Grasshopper.dll)

public static bool BalancedCharTest( string str, char char_open, char char_close, out int error_at )
Public Shared Function BalancedCharTest ( str As String, char_open As Char, char_close As Char, <OutAttribute> ByRef error_at As Integer ) As Boolean
Parameters
- str
- Type: SystemString
String to parse. - char_open
- Type: SystemChar
Char that indicates an opening statement. - char_close
- Type: SystemChar
Char that indicates a closing statement. - error_at
- Type: SystemInt32
The index at which the first error appears or -1 if no error was found.
Return Value
Type: BooleanTrue if the chars are balanced, false if they are not.
