mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-27 20:41:54 +00:00
Moved Trimmed to Jellyfin.Extensions.StringExtensions
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using ICU4N.Text;
|
||||
|
||||
@@ -123,5 +125,15 @@ namespace Jellyfin.Extensions
|
||||
{
|
||||
return (_transliterator.Value is null) ? text : _transliterator.Value.Transliterate(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensures all strings are non-null and trimmed of leading an trailing blanks.
|
||||
/// </summary>
|
||||
/// <param name="values">The enumerable of strings to trim.</param>
|
||||
/// <returns>The enumeration of trimmed strings.</returns>
|
||||
public static IEnumerable<string> Trimmed(this IEnumerable<string> values)
|
||||
{
|
||||
return values.Select(i => (i ?? string.Empty).Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user