# C1.Document.Utils.FindTextInstances

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Document_Utils_FindTextInstances_" data-uid="C1.Document.Utils.FindTextInstances*">FindTextInstances Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Document_Utils_FindTextInstances_" data-uid="C1.Document.Utils.FindTextInstances*"></a>
<h4 id="C1_Document_Utils_FindTextInstances_System_String_System_String_System_Int32_System_Int32_System_Int32_System_Boolean_System_Boolean_System_Boolean_" data-uid="C1.Document.Utils.FindTextInstances(System.String,System.String,System.Int32,System.Int32,System.Int32,System.Boolean,System.Boolean,System.Boolean)">FindTextInstances(string, string, int, int, int, bool, bool, bool)</h4>
<div class="markdown level1 summary"><p>Finds instances of text in a string.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IList&lt;int&gt; FindTextInstances(string what, string where, int fromIdx, int length, int maxCount, bool forward, bool matchCase, bool word)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FindTextInstances(what As String, where As String, fromIdx As Integer, length As Integer, maxCount As Integer, forward As Boolean, matchCase As Boolean, word As Boolean) As IList(Of Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">what</span></td>
      <td><p>The text to search for.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">where</span></td>
      <td><p>The string to search.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromIdx</span></td>
      <td><p>Index in &quot;where&quot; to start search at.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">length</span></td>
      <td><p>Length of substring to search in.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maxCount</span></td>
      <td><p>Max number of instances to find.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">forward</span></td>
      <td><p>Search direction.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">matchCase</span></td>
      <td><p>Ignore case.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">word</span></td>
      <td><p>Whole word search.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>&gt;</td>
      <td><p>Array of indexes into &quot;where&quot; to the found instances.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
