I need somthning to remove the null characters from the end of my string kinda like the r trim for spaces. thanks
I need somthning to remove the null characters from the end of my string kinda like the r trim for spaces. thanks
VB Code:
Public Function StripNulls(OriginalStr As String) As String If (InStr(OriginalStr, Chr(0)) > 0) Then OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1) End If StripNulls = OriginalStr End Function
This should do the trick I believe
Code:Do Until Asc(Right(strName, 1)) <> 0
strName = Left(strName, Len(strName) - 1)
DoEvents
Loop
You could check for the null characters at the end then do a
VB Code:
Left(variable, Len(variable) - Number Of Null Characters)
Something like that anyway...
Code:Temp = Replace(variable, Chr(0), "")
Hey,
Nice solution!
:D
-mort