Skip to content

Commit 16aa5eb

Browse files
Fixed inheritdoc usage.
1 parent 835d62a commit 16aa5eb

7 files changed

Lines changed: 22 additions & 23 deletions

Source/Extensions.Equals.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ public static bool TrimmedEquals(this string? source, in ReadOnlySpan<char> othe
130130
};
131131
}
132132

133-
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
134133
/// <summary>
135134
/// Optimized equals for comparing a trimmed string with another string.
136135
/// </summary>
137136
/// <param name="other">The string to compare to.</param>
137+
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
138138
public static bool TrimmedEquals(this string? source, string? other, StringComparison stringComparison = StringComparison.Ordinal)
139139
{
140140
if (source is null) return other is null;
@@ -153,8 +153,8 @@ public static bool TrimmedEquals(this string? source, string? other, StringCompa
153153
}
154154

155155

156-
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
157156
/// <param name="trimChar">The character to trim.</param>
157+
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
158158
public static bool TrimmedEquals(this string? source, in ReadOnlySpan<char> other, char trimChar, StringComparison stringComparison = StringComparison.Ordinal)
159159
{
160160
if (source is null) return false;
@@ -171,8 +171,8 @@ public static bool TrimmedEquals(this string? source, in ReadOnlySpan<char> othe
171171
};
172172
}
173173

174-
/// <inheritdoc cref="TrimmedEquals(string?, string?, StringComparison)"/>
175174
/// <param name="trimChar">The character to trim.</param>
175+
/// <inheritdoc cref="TrimmedEquals(string?, string?, StringComparison)"/>
176176
public static bool TrimmedEquals(this string? source, string? other, char trimChar, StringComparison stringComparison = StringComparison.Ordinal)
177177
{
178178
if (source is null) return other is null;
@@ -190,8 +190,8 @@ public static bool TrimmedEquals(this string? source, string? other, char trimCh
190190
};
191191
}
192192

193-
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
194193
/// <param name="trimChars">The characters to trim.</param>
194+
/// <inheritdoc cref="TrimmedEquals(string, in ReadOnlySpan{char}, StringComparison)"/>
195195
public static bool TrimmedEquals(this string? source, in ReadOnlySpan<char> other, in ReadOnlySpan<char> trimChars, StringComparison stringComparison = StringComparison.Ordinal)
196196
{
197197
if (source is null) return false;
@@ -208,8 +208,8 @@ public static bool TrimmedEquals(this string? source, in ReadOnlySpan<char> othe
208208
};
209209
}
210210

211-
/// <inheritdoc cref="TrimmedEquals(string?, string?, StringComparison)"/>
212211
/// <param name="trimChars">The characters to trim.</param>
212+
/// <inheritdoc cref="TrimmedEquals(string?, string?, StringComparison)"/>
213213
public static bool TrimmedEquals(this string? source, string? other, in ReadOnlySpan<char> trimChars, StringComparison stringComparison = StringComparison.Ordinal)
214214
{
215215
if (source is null) return other is null;

Source/Extensions.Split.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ static ReadOnlyMemory<char> FirstSplitMemory(string source, int start, int i, in
5353
}
5454

5555

56-
/// <inheritdoc cref="FirstSplit(ReadOnlySpan{char}, char, out int)"/>
5756
/// <param name="startIndex">The index to start the split.</param>
57+
/// <inheritdoc cref="FirstSplit(ReadOnlySpan{char}, char, out int)"/>
5858
public static ReadOnlySpan<char> FirstSplit(this string source,
5959
char splitCharacter,
6060
out int nextIndex,
@@ -74,8 +74,8 @@ public static ReadOnlySpan<char> FirstSplit(this string source,
7474
return FirstSplitSpan(source, startIndex, source.IndexOf(splitCharacter, startIndex), 1, out nextIndex);
7575
}
7676

77-
/// <inheritdoc cref="FirstSplit(ReadOnlySpan{char}, ReadOnlySpan{char}, out int, StringComparison)"/>
7877
/// <param name="startIndex">The index to start the split.</param>
78+
/// <inheritdoc cref="FirstSplit(ReadOnlySpan{char}, ReadOnlySpan{char}, out int, StringComparison)"/>
7979
public static ReadOnlySpan<char> FirstSplit(this string source,
8080
string splitSequence,
8181
out int nextIndex,

Source/Extensions.StringSegment.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public static partial class Extensions
1212
public static StringSegment AsSegment(this string source)
1313
=> StringSegment.Create(source);
1414

15-
/// <inheritdoc cref="AsSegment(string)"/>
1615
/// <param name="start">The index to start the segment.</param>
16+
/// <inheritdoc cref="AsSegment(string)"/>
1717
public static StringSegment AsSegment(this string source, int start)
1818
=> StringSegment.Create(source, start);
1919

20-
/// <inheritdoc cref="AsSegment(string, int)"/>
2120
/// <param name="length">The length of the segment.</param>
21+
/// <inheritdoc cref="AsSegment(string, int)"/>
2222
public static StringSegment AsSegment(this string source, int start, int length)
2323
=> StringSegment.Create(source, start, length);
2424

@@ -87,10 +87,10 @@ public static StringSegment First(this StringSegment source, string search, Stri
8787
return First(source, search.AsSpan(), comparisonType);
8888
}
8989

90-
/// <inheritdoc cref="First(string, string, StringComparison)"/>
9190
/// <summary>
9291
/// Finds the last instance of a string and returns a StringSegment for subsequent use.
9392
/// </summary>
93+
/// <inheritdoc cref="First(string, string, StringComparison)"/>
9494
public static StringSegment Last(this string source, string search, StringComparison comparisonType = StringComparison.Ordinal)
9595
{
9696
if (source is null) throw new ArgumentNullException(nameof(source));
@@ -104,11 +104,11 @@ public static StringSegment Last(this string source, string search, StringCompar
104104
return i == -1 ? default : StringSegment.Create(source, i, search.Length);
105105
}
106106

107-
/// <inheritdoc cref="First(string, Regex)"/>
108107
/// <summary>
109108
/// Finds the last instance of a pattern and returns a StringSegment for subsequent use.
110109
/// </summary>
111110
/// <remarks>If the pattern is right-to-left, then it will return the last segment from the right (first segment from the left).</remarks>
111+
/// <inheritdoc cref="First(string, Regex)"/>
112112
public static StringSegment Last(this string source, Regex pattern)
113113
{
114114
if (source is null) throw new ArgumentNullException(nameof(source));

Source/Extensions.Trim.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ private static ReadOnlySpan<char> TrimStartPatternCore(ReadOnlySpan<char> source
3030
return source;
3131
}
3232

33-
/// <inheritdoc cref="TrimStartPattern(string, Regex)"/>
3433
/// <param name="comparisonType">The comparison type to use when searching. Default is ordinal.</param>
3534
/// <param name="max">The maximum number of times to remove the specified sequence. -1 (default) = all instances.</param>
35+
/// <inheritdoc cref="TrimStartPattern(string, Regex)"/>
3636
public static ReadOnlySpan<char> TrimStartPattern(this ReadOnlySpan<char> source,
3737
in ReadOnlySpan<char> pattern,
3838
StringComparison comparisonType = StringComparison.Ordinal,
@@ -59,8 +59,8 @@ public static ReadOnlySpan<char> TrimStartPattern(this ReadOnlySpan<char> source
5959
return TrimStartPatternCore(source, pattern.AsSpan(), comparisonType, max);
6060
}
6161

62-
/// <inheritdoc cref="TrimStartPattern(ReadOnlySpan{char}, in ReadOnlySpan{char}, StringComparison, int)"/>
6362
/// <remarks>To any allocations, call .AsSpan() before calling this method name.</remarks>
63+
/// <inheritdoc cref="TrimStartPattern(ReadOnlySpan{char}, in ReadOnlySpan{char}, StringComparison, int)"/>
6464
public static string TrimStartPattern(this string source,
6565
string pattern,
6666
StringComparison comparisonType = StringComparison.Ordinal,
@@ -181,8 +181,8 @@ private static ReadOnlySpan<char> TrimEndPatternCore(ReadOnlySpan<char> source,
181181
return source;
182182
}
183183

184-
/// <inheritdoc cref="TrimEndPattern(string, Regex)"/>
185184
/// <param name="comparisonType">The comparison type to use when searching. Default is ordinal.</param>
185+
/// <inheritdoc cref="TrimEndPattern(string, Regex, int)"/>
186186
public static ReadOnlySpan<char> TrimEndPattern(this ReadOnlySpan<char> source,
187187
in ReadOnlySpan<char> pattern,
188188
StringComparison comparisonType = StringComparison.Ordinal,
@@ -211,8 +211,8 @@ public static ReadOnlySpan<char> TrimEndPattern(this ReadOnlySpan<char> source,
211211
return TrimEndPatternCore(source, pattern.AsSpan(), comparisonType, max);
212212
}
213213

214-
/// <inheritdoc cref="TrimEndPattern(ReadOnlySpan{char}, in ReadOnlySpan{char}, StringComparison, int)"/>
215214
/// <remarks>To any allocations, call .AsSpan() before calling this method name.</remarks>
215+
/// <inheritdoc cref="TrimEndPattern(ReadOnlySpan{char}, in ReadOnlySpan{char}, StringComparison, int)"/>
216216
public static string TrimEndPattern(this string source,
217217
string pattern,
218218
StringComparison comparisonType = StringComparison.Ordinal,

Source/Open.Text.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<RepositoryUrl>https://github.com/Open-NET-Libraries/Open.Text</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<PackageTags>dotnet, dotnetcore, string, span, readonlyspan, text, format, split, trim, equals, trimmed equals, first, last, preceding, following, stringbuilder, extensions</PackageTags>
20-
<Version>3.3.1</Version>
20+
<Version>3.3.3</Version>
2121
<PackageReleaseNotes></PackageReleaseNotes>
2222
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2323
<PublishRepositoryUrl>true</PublishRepositoryUrl>

Source/StringComparable.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public override int GetHashCode()
8686

8787
public static class StringComparableExtensions
8888
{
89-
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
9089
/// <summary>
9190
/// Prepares a string for a specific StringComparison.
9291
/// </summary>
92+
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
9393
public static StringComparable AsComparable(this string source, StringComparison type)
9494
=> new(source, type);
9595

@@ -100,28 +100,27 @@ public static StringComparable AsComparable(this string source, StringComparison
100100
public static StringComparable AsCaseInsensitive(this string source)
101101
=> new(source, StringComparison.OrdinalIgnoreCase);
102102

103-
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
104103
/// <summary>
105104
/// Prepares a string to be invariant culture and case insensitive when comparing equality.
106105
/// </summary>
106+
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
107107
public static StringComparable AsCaseInsensitiveInvariantCulture(this string source)
108108
=> new(source, StringComparison.InvariantCultureIgnoreCase);
109109

110-
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
111110
/// <summary>
112111
/// Prepares a string to be invariant culture and case insensitive when comparing equality.
113112
/// </summary>
113+
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
114114
public static StringComparable AsCaseInsensitiveCurrentCulture(this string source)
115115
=> new(source, StringComparison.CurrentCultureIgnoreCase);
116116

117-
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
118117
/// <summary>
119118
/// Prepares a string to be current culture and case sensitive when comparing equality.
120119
/// </summary>
120+
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
121121
public static StringComparable AsCurrentCulture(this string source)
122122
=> new(source, StringComparison.CurrentCulture);
123123

124-
/// <inheritdoc cref="AsCaseInsensitive(string)"/>
125124
/// <summary>
126125
/// Prepares a string to be invariant culture and case sensitive when comparing equality.
127126
/// </summary>

Source/StringSegment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public StringSegment Preceding(bool includeSegment = false)
7272
public StringSegment Following(bool includeSegment = false)
7373
=> IsValid ? Create(Source, includeSegment ? Index : (Index + Length)) : default;
7474

75-
/// <inheritdoc cref="Preceding"/>
7675
/// <param name="maxCharacters">The max number of characters to get.</param>
76+
/// <inheritdoc cref="Preceding"/>
7777
public StringSegment Preceding(int maxCharacters, bool includeSegment = false)
7878
{
7979
if (maxCharacters < 0) throw new ArgumentOutOfRangeException(nameof(maxCharacters), maxCharacters, "Must be at least zero.");
@@ -83,8 +83,8 @@ public StringSegment Preceding(int maxCharacters, bool includeSegment = false)
8383
return new(Source, start, includeSegment ? (Index - start + Length) : (Index - start));
8484
}
8585

86-
/// <inheritdoc cref="Following"/>
8786
/// <param name="maxCharacters">The max number of characters to get.</param>
87+
/// <inheritdoc cref="Following"/>
8888
public StringSegment Following(int maxCharacters, bool includeSegment = false)
8989
{
9090
if (maxCharacters < 0) throw new ArgumentOutOfRangeException(nameof(maxCharacters), maxCharacters, "Must be at least zero.");

0 commit comments

Comments
 (0)