Initial population
This commit is contained in:
41
JRCookbookBusiness/SharedRoutines.cs
Normal file
41
JRCookbookBusiness/SharedRoutines.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JRCookbookBusiness
|
||||
{
|
||||
internal static class SharedRoutines
|
||||
{
|
||||
public static string RemoveSpecialCharactersFromFileName(string str)
|
||||
{
|
||||
return Regex.Replace(str, "[^a-zA-Z0-9_. ]+", String.Empty, RegexOptions.Compiled);
|
||||
}
|
||||
|
||||
|
||||
internal static string GenerateTrackbackLinks(List<Trackback> trackbackList)
|
||||
{
|
||||
bool firstTrackback = true;
|
||||
|
||||
StringBuilder trackbacksHTML = new StringBuilder();
|
||||
foreach(Trackback trackback in trackbackList)
|
||||
{
|
||||
if (firstTrackback)
|
||||
{
|
||||
firstTrackback = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
trackbacksHTML.Append(" > ");
|
||||
}
|
||||
|
||||
trackbacksHTML.Append(trackback.GenerateLink());
|
||||
}
|
||||
|
||||
return trackbacksHTML.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user