# C1.Win.C1Editor.C1Editor.CreateRange

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Editor_C1Editor_CreateRange_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange*">CreateRange Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Editor_C1Editor_CreateRange_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange*"></a>
<h4 id="C1_Win_C1Editor_C1Editor_CreateRange" data-uid="C1.Win.C1Editor.C1Editor.CreateRange">CreateRange()</h4>
<div class="markdown level1 summary"><p>Creates a text range.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1TextRange CreateRange()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateRange() As C1TextRange</code></pre>
</div>
<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="C1.Win.C1Editor.C1TextRange.html">C1TextRange</a></td>
      <td><p>A new text range.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_C1Editor_C1Editor_CreateRange_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange*"></a>
<h4 id="C1_Win_C1Editor_C1Editor_CreateRange_System_Int32_System_Int32_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange(System.Int32,System.Int32)">CreateRange(int, int)</h4>
<div class="markdown level1 summary"><p>Creates a range that begins with the specified starting character and continues through the specified length of characters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1TextRange CreateRange(int start, int length)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateRange(start As Integer, length As Integer) As C1TextRange</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">start</span></td>
      <td><p>The start position</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>The length of the range</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="C1.Win.C1Editor.C1TextRange.html">C1TextRange</a></td>
      <td><p>The text range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Editor_C1Editor_CreateRange_System_Int32_System_Int32__examples">Examples</h5>
<p>This code demonstrates the <a class="xref" href="C1.Win.C1Editor.C1Editor.CreateRange.html#C1_Win_C1Editor_C1Editor_CreateRange_System_Int32_System_Int32_">CreateRange(int, int)</a> method.
<pre><code class="lang-csharp"> private void button1_Click(object sender, EventArgs e)
{
c1Editor1.LoadXml(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Document&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;12&lt;span&gt;3&lt;/span&gt;456&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;&quot;, new Uri(&quot;c:\&quot;));
C1TextRange r = c1Editor1.CreateRange(1, 3);
Console.WriteLine(r.Text);
// Output: 234
}</code></pre>



<a id="C1_Win_C1Editor_C1Editor_CreateRange_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange*"></a>
<h4 id="C1_Win_C1Editor_C1Editor_CreateRange_System_Xml_XmlNode_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange(System.Xml.XmlNode)">CreateRange(XmlNode)</h4>
<div class="markdown level1 summary"><p>Creates a range on the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.xmlnode">XmlNode</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1TextRange CreateRange(XmlNode node)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateRange(node As XmlNode) As C1TextRange</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.xml.xmlnode">XmlNode</a></td>
      <td><span class="parametername">node</span></td>
      <td><p>The target node.</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="C1.Win.C1Editor.C1TextRange.html">C1TextRange</a></td>
      <td><p>The text range.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_C1Editor_C1Editor_CreateRange_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange*"></a>
<h4 id="C1_Win_C1Editor_C1Editor_CreateRange_C1_Win_C1Editor_C1TextPointer_C1_Win_C1Editor_C1TextPointer_" data-uid="C1.Win.C1Editor.C1Editor.CreateRange(C1.Win.C1Editor.C1TextPointer,C1.Win.C1Editor.C1TextPointer)">CreateRange(C1TextPointer, C1TextPointer)</h4>
<div class="markdown level1 summary"><p>Creates a range between the specified start and end <a class="xref" href="C1.Win.C1Editor.C1TextPointer.html">C1TextPointer</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1TextRange CreateRange(C1TextPointer start, C1TextPointer end)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateRange(start As C1TextPointer, [end] As C1TextPointer) As C1TextRange</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="C1.Win.C1Editor.C1TextPointer.html">C1TextPointer</a></td>
      <td><span class="parametername">start</span></td>
      <td><p>The start pointer.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.C1Editor.C1TextPointer.html">C1TextPointer</a></td>
      <td><span class="parametername">end</span></td>
      <td><p>The end pointer.</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="C1.Win.C1Editor.C1TextRange.html">C1TextRange</a></td>
      <td><p>The text range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Editor_C1Editor_CreateRange_C1_Win_C1Editor_C1TextPointer_C1_Win_C1Editor_C1TextPointer__examples">Examples</h5>
<p>This code demonstrates the <a class="xref" href="C1.Win.C1Editor.C1Editor.CreateRange.html#C1_Win_C1Editor_C1Editor_CreateRange_System_Int32_System_Int32_">CreateRange(int, int)</a> method.
<pre><code class="lang-csharp"> private void button1_Click(object sender, EventArgs e)
{
c1Editor1.LoadXml(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Document&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;12&lt;span&gt;3&lt;/span&gt;456&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;&quot;, new Uri(&quot;c:\&quot;));
C1TextRange r = c1Editor1.CreateRange(1, 3);
Console.WriteLine(r.Text);
// Output: 234
}</code></pre>

</div>
