Skip to content

Instantly share code, notes, and snippets.

@mmurray
Created November 12, 2010 22:57
Show Gist options
  • Save mmurray/674858 to your computer and use it in GitHub Desktop.
Save mmurray/674858 to your computer and use it in GitHub Desktop.
public string GetStoryTags()
{
List<string> sects = new List<string>();
sects.Add("subSubSection text");
sects.Add("subSection text");
sects.Add("section text");
string tags = string.Join(",", sects.ToArray());
Regex r = new Regex("[^a-zA-Z0-9|\\x20|\\-|,]");
tags = r.Replace(tags, "");
Regex r2 = new Regex("\\x20+");
tags = r2.Replace(tags, "-");
return tags.ToLower();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment