Skip to content

Commit 81847e3

Browse files
committed
Improve documentation clarity and correctness
Updated XML documentation in `AssemblyExtensions` to use `<see langword="false"/>` and `<see langword="default"/>`. Corrected return type in `DateTimeExtensions.ToDateOnly` from `<see cref="TimeOnly"/>` to `<see cref="DateOnly"/>`. Fixed spelling of "insensitive" in multiple methods of `StringExtensions`, enhancing overall documentation quality.
1 parent 4123ad5 commit 81847e3

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/TinyHelpers/Extensions/AssemblyExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public static class AssemblyExtensions
1818
/// </param>
1919
/// <param name="inherit">
2020
/// A boolean value indicating whether to search the inheritance chain to find the attributes.
21-
/// Defaults to <c>false</c>.
21+
/// Defaults to <see langword="false"/>.
2222
/// </param>
2323
/// <returns>
24-
/// A value of type <typeparamref name="TValue"/> extracted from the attribute using the delegate, or <c>default</c> if the attribute is not found.
24+
/// A value of type <typeparamref name="TValue"/> extracted from the attribute using the delegate, or <see langword="default"/> if the attribute is not found.
2525
/// </returns>
2626
public static TValue? GetAttribute<T, TValue>(this Assembly assembly, Func<T, TValue> value, bool inherit = false)
2727
where T : Attribute

src/TinyHelpers/Extensions/DateTimeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class DateTimeExtensions
1111
/// Constructs a <see cref="DateOnly"/> object that is set to the date part of the specified <see cref="DateTime"/>.
1212
/// </summary>
1313
/// <param name="dateTime">The <see cref="DateTime"/> object to extract the date part from.</param>
14-
/// <returns>A <see cref="TimeOnly"/> object representing date of the day specified in the <paramref name="dateTime"/> object.</returns>
14+
/// <returns>A <see cref="DateOnly"/> object representing date of the day specified in the <paramref name="dateTime"/> object.</returns>
1515
/// <seealso cref="DateTime"/>
1616
/// <seealso cref="DateOnly"/>
1717
public static DateOnly ToDateOnly(this DateTime dateTime)

src/TinyHelpers/Extensions/StringExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ namespace TinyHelpers.Extensions;
99
public static class StringExtensions
1010
{
1111
/// <summary>
12-
/// Determines whether two specified <see cref="string"/> objects have the same value, performing a case-insentive comparison.
12+
/// Determines whether two specified <see cref="string"/> objects have the same value, performing a case-insensitive comparison.
1313
/// </summary>
1414
/// <param name="a">The first string to compare.</param>
1515
/// <param name="b">The second string to compare.</param>
16-
/// <returns><see langword="true"/> if the value of <paramref name="b"/> is the same as the value of <paramref name="b"/>, regardless the casing; otherwise, <see langword="false"/>. If both <paramref name="a"/> and <paramref name="b"/> are <see langword="null"/>, the method returns <see langword="true"/>.</returns>
16+
/// <returns><see langword="true"/> if the value of <paramref name="a"/> is the same as the value of <paramref name="b"/>, regardless the casing; otherwise, <see langword="false"/>. If both <paramref name="a"/> and <paramref name="b"/> are <see langword="null"/>, the method returns <see langword="true"/>.</returns>
1717
public static bool EqualsIgnoreCase(this string? a, string? b)
1818
=> string.Equals(a, b, StringComparison.OrdinalIgnoreCase);
1919

2020
/// <summary>
21-
/// Determines whether the beginning of this string instance matches the specified string, performing a case-insentive comparison.
21+
/// Determines whether the beginning of this string instance matches the specified string, performing a case-insensitive comparison.
2222
/// </summary>
2323
/// <param name="input">The string to check.</param>
2424
/// <param name="value">The string to compare.</param>
@@ -27,7 +27,7 @@ public static bool StartsWithIgnoreCase(this string? input, string value)
2727
=> input?.StartsWith(value, StringComparison.OrdinalIgnoreCase) ?? false;
2828

2929
/// <summary>
30-
/// Determines whether the end of this string instance matches the specified string, performing a case-insentive comparison.
30+
/// Determines whether the end of this string instance matches the specified string, performing a case-insensitive comparison.
3131
/// </summary>
3232
/// <param name="input">The string to check.</param>
3333
/// <param name="value">The string to compare.</param>
@@ -36,7 +36,7 @@ public static bool EndsWithIgnoreCase(this string? input, string value)
3636
=> input?.EndsWith(value, StringComparison.OrdinalIgnoreCase) ?? false;
3737

3838
/// <summary>
39-
/// Determines whether this string instance contains the specified string, performing a case-insentive comparison.
39+
/// Determines whether this string instance contains the specified string, performing a case-insensitive comparison.
4040
/// </summary>
4141
/// <param name="input">The string to check.</param>
4242
/// <param name="value">The string to compare.</param>
@@ -48,7 +48,7 @@ public static bool ContainsIgnoreCase(this string? input, string value)
4848
/// Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string, ignoring the letter casing.
4949
/// </summary>
5050
/// <param name="input">The original string.</param>
51-
/// <param name="pattern">The string to be replaced, case insentive.</param>
51+
/// <param name="pattern">The string to be replaced, case insensitive.</param>
5252
/// <param name="replacement">The string to be used to replace all occurrences of <paramref name="pattern"/>.</param>
5353
/// <returns>A string that is equivalent to the <paramref name="input"/> string except that all instances of <paramref name="pattern"/> are replaced with <paramref name="replacement"/>.</returns>
5454
public static string ReplaceIgnoreCase(this string input, string pattern, string replacement)

0 commit comments

Comments
 (0)