' Collection of code snippets by Arne Vajhøj ' posted to eksperten.dk, usenet and other places (2002-now) Option Strict Option Explicit Imports System Module Program Public Function UrlConvert(url As String) As String Dim parts() As String = url.Split("/".ToCharArray()) Dim dummy As Integer If Integer.TryParse(parts(parts.Length - 1), dummy) Then Return "Module=Content&Id=" & parts(parts.Length - 1) Else Return "Module=" & parts(1) End If End Function Sub Main() Console.WriteLine(UrlConvert("/login")) Console.WriteLine(UrlConvert("/content/1")) End Sub End Module