ToUrlFriendlyString() public static method

Makes a "web-friendly" string suitable for us in URLs. For example, "Three Little words! - v2.txt" -> "Three-Little-words-v2.txt"
public static ToUrlFriendlyString ( string s ) : string
s string
return string
Ejemplo n.º 1
0
        /// <summary>
        /// Gets a path like "data/3148e1e2-bd6b-4623-b72a-5408263b9056-Some-Data-File.csv"
        /// </summary>
        public static string GetUnrootedDataPath(Guid recordId, string filePath)
        {
            string fileName = Path.GetFileName(filePath);

            // make a file name suitable for the web
            string name = WebificationUtility.ToUrlFriendlyString(fileName);

            return(String.Format("data/{0}-{1}", recordId, name));
        }
Ejemplo n.º 2
0
 public string test_to_url_friendly_string(string s)
 {
     return(WebificationUtility.ToUrlFriendlyString(s));
 }