I have pyear : 94-4 and pnum: 158
I would like to remove "-4" from pyear and replace as "1994158".
Also, I have pyear: 9704p and pnum: 221
I would like to remove "04p" from pyear and replace as "1997221"
I tried wih my code but it doesn't work
If pyear.Substring(0, 1) = "4" Then
pyear = "19" + pyear.Substring(0, 1)
ElseIf pyear.Length = 5 Then
plyear = pyear.Substring(0, 4)
If pyear.Contains("-") Then
pyear = Trim(Split(pyear, "-", , CompareMethod.Text)(0))
end if