# IReaderRangeTokenCounter

Optional token-counter extension that counts a prefix and source range without allocating a substring.

Interface 

`OfficeIMO.Reader`

**Namespace**

`OfficeIMO.Reader`

**Assembly**

`OfficeIMO.Reader.Core`

**Source revision**

`013c05ace7bb` with working tree changes

**Source**

[ReaderDelegateTokenCounter.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Reader.Core/ReaderDelegateTokenCounter.cs#L5)

**Implements**

`IReaderTokenCounter`

**Modifiers**

abstract

Optional token-counter extension that counts a prefix and source range without allocating a substring.

## Remarks

The result must equal CountTokens(prefix + source.Substring(start, length)).

Filter members 

Show inherited

## Methods

`public abstract int CountTokens(string prefix, string source, int start, int length)` [#](#method-counttokens-string-string-int32-int32)

Counts the exact concatenated output projection represented by a prefix and source range.

Parameters

**prefix string required**

**source string required**

**start int required**

**length int required**

Returns

`int`

<!-- PowerForge markdown artifact sha256:F3C50E2FC394A03776D7CC09F2EA57F4CD691805F40D23438790FE7ECFD772F0 -->
