Always use “$-typed” string functions

Always use “$-typed” string functions

VB official documentation seems to encourage you to use “$-less” string functions, e.g. Left, LTrim or UCase, instead of their time-honored Left$, LTrim$ and UCase$ counterparts. If you do so, however, you should be aware that the former ones return a variant value that, when used within string expressions, must be converted to string anyway.

For this reason, in time-critical code you should opt for the old-styled string functions, that are 5-10% faster.


Share the Post: