2011-09-05 19:59:39 +00: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 16:37:34 +00:00
|
|
|
|
if (String.IsNullOrEmpty(input))
|
|
|
|
|
return String.Empty;
|
|
|
|
|
|
2011-09-05 19:59:39 +00: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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|