2011-09-05 22:59:39 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Helpers
|
|
|
|
{
|
|
|
|
public class SortHelper
|
|
|
|
{
|
|
|
|
public static string SkipArticles(string input)
|
|
|
|
{
|
2011-10-06 19:37:34 +03:00
|
|
|
if (String.IsNullOrEmpty(input))
|
|
|
|
return String.Empty;
|
|
|
|
|
2011-09-05 22:59:39 +03:00
|
|
|
var articles = new List<string> { "The ", "An ", "A " };
|
|
|
|
|
|
|
|
foreach (string article in articles)
|
|
|
|
{
|
|
|
|
if (input.ToLower().StartsWith(article, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
return input.Substring(article.Length).Trim();
|
|
|
|
}
|
|
|
|
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|