I found online that it is a vb string function. The page said the "Right$" is more efficient than simply writing "Right"
VB6 had (and VBA still has) two versions of many string functions.
One version accepted and returned String
s, another one accepted and returned Variant
s. The string versions had $
in their name to make them stand out.
One cannot say that using Right$
is always better than using Right
. It depends on the type of your source and result data.
If you receive data as Variant
s and send it out as Variant
s, like e.g. Excel does, using Right
will result in fewer conversions between String
and Variant
.
If your data is originally a String
, using Right$
is better.
So is this still current with the most up to date vb language features or is it deprecated?
VB.NET only includes the typed versions, but it does not show the $
anymore.
So Right$
is the up to date version, but it was renamed to simply Right
. There is no choice anymore.
There is still choice in VBA, where both versions are valid and supported.