diff options
| author | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
|---|---|---|
| committer | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
| commit | a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch) | |
| tree | a74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Controller/Sorting/SortHelper.cs | |
| parent | 9bac3ac616b01f67db98381feb09d34ebe821f9a (diff) | |
Add GPL modules
Diffstat (limited to 'MediaBrowser.Controller/Sorting/SortHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/Sorting/SortHelper.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Sorting/SortHelper.cs b/MediaBrowser.Controller/Sorting/SortHelper.cs new file mode 100644 index 000000000..3456b9b04 --- /dev/null +++ b/MediaBrowser.Controller/Sorting/SortHelper.cs @@ -0,0 +1,25 @@ +namespace MediaBrowser.Controller.Sorting +{ + public static class SortHelper + { + private enum ChunkType { Alphanumeric, Numeric }; + + public static bool InChunk(char ch, char otherCh) + { + var type = ChunkType.Alphanumeric; + + if (char.IsDigit(otherCh)) + { + type = ChunkType.Numeric; + } + + if ((type == ChunkType.Alphanumeric && char.IsDigit(ch)) + || (type == ChunkType.Numeric && !char.IsDigit(ch))) + { + return false; + } + + return true; + } + } +} |
