Remove additional slashes from URL
问题 In ASP.Net it is posible to get same content from almost equal pages by URLs like localhost:9000/Index.aspx and localhost:9000//Index.aspx or even localhost:9000///Index.aspx But it isn't looks good for me. How can i remove this additional slashes before user go to some page and in what place? 回答1: Use this : url = Regex.Replace(url , @"/+", @"/"); it will support n times 回答2: see https://stackoverflow.com/a/19689870 https://msdn.microsoft.com/en-us/library/9hst1w91.aspx#Examples You need to