Skip to content

Commit

Permalink
Updated nullable annotations for the StringUtils.FirstWithValue methods
Browse files Browse the repository at this point in the history
  • Loading branch information
abjerner committed Jun 2, 2023
1 parent 6b8594f commit 7ccd11d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Skybrud.Essentials/Strings/StringUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public static string FirstWithValue(string? value1, string? value2) {
/// </summary>
/// <param name="values">Array of string values.</param>
/// <returns>The first value or <see cref="string.Empty"/>.</returns>
public static string FirstWithValue(params string[]? values) {
public static string FirstWithValue(params string?[]? values) {
return values?.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)) ?? string.Empty;
}

Expand All @@ -497,7 +497,7 @@ public static string FirstWithValue(params string[]? values) {
/// </summary>
/// <param name="values">Collection of string values.</param>
/// <returns>The first value or <see cref="string.Empty"/>.</returns>
public static string FirstWithValue(IEnumerable<string>? values) {
public static string FirstWithValue(IEnumerable<string?>? values) {
return values?.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)) ?? string.Empty;
}

Expand Down

0 comments on commit 7ccd11d

Please sign in to comment.