mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			613 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			613 B
		
	
	
	
		
			C#
		
	
	
	
	
	
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;
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |