Quote Originally Posted by snb View Post
Function F_RemovePrefix(s As String) As String
  F_RemovePrefix = mid(s,5)
End Function
But as a function it's unnecessarily complicated

this would do as well

if left(s,4)="\\?\" then s = mid(s,5)
Well, the first version will ALWAYS remove the first 4 characters, even if they're not "\\?"

The use of Mid() might seem to be a little faster (at least less typing) since it replaces a Len() and a Right(), but according to

https://www.aivosto.com/articles/stringopt2.html

Left$, Right$ and Mid$. Performance keeps at the degraded level with this group of functions. These functions create new strings by copying some characters in the input string. These are the only functions that can access the individual characters in a string. As you can see, Mid$ is slower than Left$ or Right$. This means you should use Left$ and Right$ when possible and only resort to Mid$ when you really need to access characters in the middle.
Capture.JPG

Even called a few 1000 times, either won't make a perceptable wall clock difference. Probably get more performance by not using the Variant form of the functions and using the String versions (Mid$(...) instead of Mid(...)