The $ sign was used to denote the type of the variable long, long ago in VB6 for both functions and variables . They were never recommended for variables, as they should always have been explicitly declared as follows:
Dim myValue As String
not a great practice:
myValue$ = ""
However, from time to time it was good practice to use some functions, such as the Right () function , which used the Type option . Variants can be variables of any type and are considered bad in terms of performance. When using strings with functions such as Right (), Left (), Mid (), etc., It would be better to be explicit and indicate that it was a string for performance reasons, as shown below:
Right$(myValue, 3)
The only exception to this practice was the Replace () function.
Now, the only reason it is stored in the Microsoft.VisualBasic .NET namespace is for grandfather or to convert VB6 code to VB.NET for compatibility reasons. There is no need to write new code using a notation indicating that you are using the String type with these functions.
Hope this helps!
source share