 | balancedBalancedT Method (IEnumerableT, IEnumerableTupleT, T, NullableInt32) |
Checks whether an
IEnumerableT is balanced, in terms of openers and closers.
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic static bool Balanced<T>(
this IEnumerable<T> this,
IEnumerable<Tuple<T, T>> couples,
Nullable<int> maxdepth = null
)
Parameters
- this
- Type: System.Collections.GenericIEnumerableT
The IEnumerableT to check for balance. - couples
- Type: System.Collections.GenericIEnumerableTupleT, T
An IEnumerableT of openers and closers of many types, each one closing and opening only itself. - maxdepth (Optional)
- Type: SystemNullableInt32
The maximum depths of parenthesis allowed, on for no depth limit. maxdepth is inclusive
Type Parameters
- T
- The type of the IEnumerableT.
Return Value
Type:
BooleanWhether
this is balanced, and it's maximum depth is no more than
maxdepth, if one is stated.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
See Also