Example #1
0
 public static string GenerateSlug(string str, bool hierarchical = true)
 {
     if (App.get_Hooks() != null && App.get_Hooks().get_OnGenerateSlug() != null)
     {
         return(App.get_Hooks().get_OnGenerateSlug().Invoke(str));
     }
     V_0 = str.Trim().ToLower();
     V_0 = V_0.Replace("å", "a").Replace("ä", "a").Replace("á", "a").Replace("à", "a").Replace("ö", "o").Replace("ó", "o").Replace("ò", "o").Replace("é", "e").Replace("è", "e").Replace("í", "i").Replace("ì", "i");
     V_0 = Regex.Replace(V_0, "[^a-z0-9-/ ]", "").Replace("--", "-");
     V_0 = Regex.Replace(V_0.Replace("-", " "), "\\s+", " ").Replace(" ", "-");
     if (!hierarchical)
     {
         V_0 = V_0.Replace("/", "-");
     }
     V_0 = Regex.Replace(V_0, "[-]+", "-");
     if (V_0.EndsWith("-"))
     {
         V_0 = V_0.Substring(0, V_0.LastIndexOf("-"));
     }
     if (V_0.StartsWith("-"))
     {
         V_0 = V_0.Substring(Math.Min(V_0.IndexOf("-") + 1, V_0.get_Length()));
     }
     return(V_0);
 }
Example #2
0
			private string GetMemberNonExplicitName(IMemberDefinition member)
			{
				V_0 = member.get_Name();
				V_1 = V_0.LastIndexOf('.');
				if (V_1 != -1)
				{
					V_0 = V_0.Substring(V_1 + 1);
				}
				return V_0;
			}