Skip to content

Commit 0a33824

Browse files
committed
Deploying to gh-pages from @ e4424c2 🚀
1 parent a2044a5 commit 0a33824

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

.doctrees/environment.pickle

496 Bytes
Binary file not shown.
Binary file not shown.

_sources/tutorials/programming-language/main/02-00-basics/02-04-data-types.rst.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ You can slice a string with ``[start:end]``. Negative values represent position
8585
string s1 = greeting[7:12]; // => "world"
8686
string s2 = greeting[-4:-2]; // => "or"
8787
88-
Note that indices in Vala start with 0 as in most other programming languages. Starting with Vala 0.11 you can access a single byte of a string with ``[index]``:
88+
Note that indices in Vala start with 0 as in most other programming languages; the start index is inclusive and the end index is exclusive. An empty slice may be `null`.
89+
90+
You can access a single byte of a string with ``[index]``:
8991

9092
.. code-block:: vala
9193

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tutorials/programming-language/main/02-00-basics/02-04-data-types.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ <h2><span class="section-number">2.4.2. </span>Strings<a class="headerlink" href
612612
<span class="kt">string</span><span class="w"> </span><span class="n">s2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">greeting</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="o">:-</span><span class="mi">2</span><span class="p">];</span><span class="w"> </span><span class="c1">// =&gt; &quot;or&quot;</span>
613613
</pre></div>
614614
</div>
615-
<p>Note that indices in Vala start with 0 as in most other programming languages. Starting with Vala 0.11 you can access a single byte of a string with <code class="docutils literal notranslate"><span class="pre">[index]</span></code>:</p>
615+
<p>Note that indices in Vala start with 0 as in most other programming languages; the start index is inclusive and the end index is exclusive. An empty slice may be <cite>null</cite>.</p>
616+
<p>You can access a single byte of a string with <code class="docutils literal notranslate"><span class="pre">[index]</span></code>:</p>
616617
<div class="highlight-vala notranslate"><div class="highlight"><pre><span></span><span class="kt">uint8</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">greeting</span><span class="p">[</span><span class="mi">7</span><span class="p">];</span><span class="w"> </span><span class="c1">// =&gt; 0x77</span>
617618
</pre></div>
618619
</div>

0 commit comments

Comments
 (0)