Skip to content

Commit acaebf9

Browse files
committed
Docs
1 parent 4ef4efb commit acaebf9

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

NStack/NStack.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup>
66
<TargetFramework>netstandard1.5</TargetFramework>
77
<PackageId>NStack.Core</PackageId>
8-
<PackageVersion>0.7</PackageVersion>
8+
<PackageVersion>0.8</PackageVersion>
99
<Authors>Miguel de Icaza</Authors>
1010
<PackageLicenseUrl>https://github.com/migueldeicaza/NStack/blob/master/LICENSE.md</PackageLicenseUrl>
1111
<Owners>Miguel de Icaza</Owners>
@@ -19,7 +19,8 @@ It starts with a new string type that is focused on Unicode code-points as oppos
1919
<ReleaseVersion>0.3</ReleaseVersion>
2020
<PackageReleaseNotes>* Renamed some methods to match the equivalent methods in Char.
2121
* Introduced Substring (int start)
22-
* Introduced difference between this [int start, int end] and this [int start, object end] the latter used to mean "until the end", replacing '0' as the previous value for "until the end".</PackageReleaseNotes>
22+
* Introduced difference between this [int start, int end] and this [int start, object end] the latter used to mean "until the end", replacing '0' as the previous value for "until the end".
23+
* Introduced new method in Rune to measure the width in columns for console applications.</PackageReleaseNotes>
2324
</PropertyGroup>
2425

2526
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

NStack/strings/ustring.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ namespace NStack {
9797
/// is exclusive. Negative values can be used to index the string from the end. See the documentation
9898
/// for the indexer for more details.
9999
/// </para>
100+
///
100101
/// </remarks>
101102
public abstract class ustring : IComparable<ustring>, IComparable, IConvertible, IEnumerable<uint>, IEquatable<ustring>
102103
#if NETSTANDARD2_0
@@ -1700,7 +1701,19 @@ public static bool Contains (ref AsciiSet aset, byte b)
17001701
/// <returns>Enumerable object that can be used to iterate and get the index of the values at the same time.</returns>
17011702
/// <remarks>
17021703
/// This is useful to iterate over the string and obtain both the index of the rune and the rune
1703-
/// in the same call.
1704+
/// in the same call. This version does allocate an object for the enumerator, if you want to avoid
1705+
/// the object allocation, you can use the following code to iterate over the contents of the string
1706+
/// <example>
1707+
/// <code lang="c#">
1708+
/// ustring mystr = "hello";
1709+
/// int byteLen = mystr.Length;
1710+
/// for (int i = 0; i &lt; byteLen;) {
1711+
/// (var rune, var size) = Utf8.DecodeRune(mystr, i, i - byteLen);
1712+
/// Console.WriteLine ("Rune is: " + rune);
1713+
/// i += size;
1714+
/// }
1715+
/// </code>
1716+
/// </example>
17041717
/// </remarks>
17051718
public IEnumerable<(int index, uint rune)> Range ()
17061719
{

0 commit comments

Comments
 (0)