Dim input As String = "Don-1234-2011" Dim parts As String() = input.Split("-"C) Dim justTheMiddle As String = parts(1)
Dim parts() as String Dim don = "don-10001-2011" Dim result as String parts = don.Split("-") result = parts(1) 'incase of zero based array else 2 for 1 based array indices
path=path.Substring(3, path.Length - 7);(
dim LastIndex as integer = 0 LastIndex = Record.LastIndexOf("-") 'As you know Don- will never change so you can hard code that part in the substring or look into the indexof function messagebox.show (Record.SubString(4, LastIndex))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)