match class : Length getter

Description

Gets a length of the substring.

Syntax

matchInstance.Length

Arguments

None

Return value

ClassDescription
intA length of the substring.

Sample code

1:

regex pattern = new regex("(b+)");

2:

match firstMatch= pattern.MatchM("aaabbbaaccc"); // "bbb"

3:

int len = firstMatch.Length; // 3

Notes

It's a wrapper of the System.Text.RegularExpressions.Match.Length property.

Links for reference

Copyright © Cooker All rights reserved.