It depends on the version of VB your'e using, but i think the main difference is that trim returns a variant and trim$ returns a string and that many say one is faster than the other... i'll make some tests later.
Anyway, i'll keep subscribed here to check other answers.
[CODE=vb]Sub HelloTest()
Dim str1 As String
Dim str2 As String
Dim t As Single
Dim t2 As Single
Dim i As Long
str1 = " hello "
t = Timer
For i = 1 To 10000000
str2 = Trim(str1)
Next
t2 = Timer - t
t = Timer
For i = 1 To 10000000
str2 = Trim$(str1)
Next
MsgBox "Trim: " & t2 & " seconds." & Chr(13) & "Trim$: " & Timer - t & " seconds."
End Sub[/CODE]
It depends on the version of VB your'e using, but i think the main difference is that trim returns a variant and trim$ returns a string and that many say one is faster than the other... i'll make some tests later.
Anyway, i'll keep subscribed here to check other answers.
Comment