# C1.Win.C1Editor.C1TextRange.Normalize

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Editor_C1TextRange_Normalize_" data-uid="C1.Win.C1Editor.C1TextRange.Normalize*">Normalize Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Editor_C1TextRange_Normalize_" data-uid="C1.Win.C1Editor.C1TextRange.Normalize*"></a>
<h4 id="C1_Win_C1Editor_C1TextRange_Normalize" data-uid="C1.Win.C1Editor.C1TextRange.Normalize">Normalize()</h4>
<div class="markdown level1 summary"><p>Moves the range pointers to the most inner text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Normalize()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Normalize()</code></pre>
</div>
<h5 id="C1_Win_C1Editor_C1TextRange_Normalize_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Different ranges can point to one and the same text, but to different XML tags. For example we have three XML-fragments:</p>
<p>&lt;p&gt;text|&lt;strong&gt;&lt;em&gt;inner text&lt;/em&gt;&lt;/strong&gt;|text&lt;/p&gt;,
&lt;p&gt;text&lt;strong&gt;|&lt;em&gt;inner text&lt;/em&gt;|&lt;/strong&gt;text&lt;/p&gt;, and
&lt;p&gt;text&lt;strong&gt;&lt;em&gt;|inner text|&lt;/em&gt;&lt;/strong&gt;text&lt;/p&gt;</p>
<p>In all three fragments the ranges point to one and the same text &quot;inner text&quot;, but they have different XML-ranges.
The Normalize method transforms the first two ranges to the third one; it moves pointers inside (into the most inner tag).
So, this method is necessary for a user to be sure that he works with a range positioned only on the text but not somewhere between elements in a document.</p>
</div>
<h5 id="C1_Win_C1Editor_C1TextRange_Normalize_examples">Examples</h5>
<p>The following example replaces the selected text with a new value.
<pre><code class="lang-csharp">C1TextRange range = _editor.Selection.Clone();
range.Text = value;
//after inserting text we must collapse selection to the end
range.Normalize();
range.Start.MoveTo(range.End);
range.Select();</code></pre>

</div>
