I was going to correct Pecoflyer's solution ("no, that just removes the last four bytes of string whether or not they're '2013' "), and checked your samples again. I see I got it wrong; it's not the first "2013" that matters, it's the last. And I thought you had at least one where more text appeared after "2013", but in all your examples every string ends that way.
So go over those sample strings again and tell me how you want them treated. That'll tell you whether Pecoflyer's solution will work for you. If it won't, your answers to the samples should enable either of us to define one that will.
|