Click or drag to resize

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)
Syntax
public static bool BalancedCharTest(
	string str,
	char char_open,
	char char_close,
	out int error_at
)

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: Boolean
True if the chars are balanced, false if they are not.
See Also