Dim filePath as String = "~/uploads/products/TestCat/Product 1b/iStock_000000106821XSmall.jpg"
Dim newCategory As String = "TempCat"
Dim test As String = ((filePath.Substring(0, filePath.LastIndexOf("/"))).Substring(0, (filePath.Substring(0, filePath.LastIndexOf("/"))).LastIndexOf("/"))).Substring(0, _
((filePath.Substring(0, filePath.LastIndexOf("/"))).Substring(0, (filePath.Substring(0, filePath.LastIndexOf("/"))).LastIndexOf("/"))).LastIndexOf("/")) & "/" & newCategory & "/" & _
(filePath.Substring(0, filePath.LastIndexOf("/"))).Substring((filePath.Substring(0, filePath.LastIndexOf("/"))).LastIndexOf("/") + 1) & "/" & (filePath.Substring(filePath.LastIndexOf("/") + 1))