# C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextBeforePosition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextBeforePosition_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextBeforePosition*">GetTextBeforePosition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextBeforePosition_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextBeforePosition*"></a>
<h4 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextBeforePosition_System_Int32_" data-uid="C1.Util.DX.DirectWrite.TextAnalysisSource.GetTextBeforePosition(System.Int32)">GetTextBeforePosition(int)</h4>
<div class="markdown level1 summary"><p>Gets a block of text immediately preceding the specified position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">string GetTextBeforePosition(int textPosition)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function GetTextBeforePosition(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 position immediately after the last position of the block of text to obtain.</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>text immediately preceding the specified position</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_TextAnalysisSource_GetTextBeforePosition_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>NULL indicates no chunk available at the specified position, either because textPosition equals 0,  textPosition is greater than the entire text content length, or the queried position is not mapped into the application's backing store. 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>
