View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dom Kershaw Dom Kershaw is offline
external usenet poster
 
Posts: 1
Default Remove the right most 3 characters from a string



I had to the same thing as I was adding 001 002 etc.. to duplicate
filenames in VB.NET
If the file existed I added 001, if that existed I added 002, but
removing the 001 etc.. sometimes removed char from the middle of the
name or the first instance, so I deleted the last three chars as
below...

I used :

templength = filename.Length
filename = filename.Substring(0, templength - 3)



*** Sent via Developersdex http://www.developersdex.com ***