# C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextAtPosition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextAtPosition_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextAtPosition*">GetTextAtPosition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextAtPosition_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextAtPosition*"></a>
<h4 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextAtPosition_System_Int32_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextAtPosition(System.Int32)">GetTextAtPosition(int)</h4>
<div class="markdown level1 summary"><p>Gets a block of text starting at the specified text position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">string GetTextAtPosition(int textPosition)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function GetTextAtPosition(textPosition As Integer) As String</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.int32">int</a></td>
      <td><span class="parametername">textPosition</span></td>
      <td><p>The first position of the piece to obtain. All positions are in UTF16 code units, not whole characters, which matters when supplementary characters are used.</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.string">string</a></td>
      <td><p>a block of text</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextAtPosition_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Returning NULL indicates the end of text, which is the position after the last character. This function is called iteratively for each consecutive block, tying together several fragmented blocks in the backing store into a virtual contiguous string. Although applications can implement sparse textual content that  maps only part of the backing store, the application must map any text that is in the range passed to any analysis functions.</p>
</div>
</div>
