diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2025-03-12 18:14:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-12 18:14:04 -0400 |
| commit | f87150bb3d32b708a886547c28e56fdd38b5115e (patch) | |
| tree | b4c73319032ef4b62d6f00e4bc9ff8971b504793 /src | |
| parent | 237e7bd44b3c9a6f76892be1c6a925bcde64bdbf (diff) | |
| parent | a5f3d942f691b914b67b098f7a64406bea569aad (diff) | |
Merge pull request #9560 from IDisposable/sort-nfo-data
Sort embedded collections in Nfo files
Diffstat (limited to 'src')
| -rw-r--r-- | src/Jellyfin.Extensions/StringExtensions.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Jellyfin.Extensions/StringExtensions.cs b/src/Jellyfin.Extensions/StringExtensions.cs index 4b9677d9f..715cbf220 100644 --- a/src/Jellyfin.Extensions/StringExtensions.cs +++ b/src/Jellyfin.Extensions/StringExtensions.cs @@ -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()); + } } } |
