May 30th, 2002, 09:51 PM
Joining a string which is split by Carriage return Line Feed
I'm stuck in a situation now..I hope someone out there can help get me out of it...here's the situation:
I now have a string as follows:
how am I able to join all the strings to form a string
i.e. delete off the carriage return line feed
Thanks in advance!
May 30th, 2002, 10:03 PM
Make sure you have a reference to the Vb Scripting dll. (Microsoft Scripting Runtime - sccrun.dll)
abcstring = replace(abcstring,chr(10),"")
abcstring = replace(abcstring,chr(13),"")
May 30th, 2002, 10:10 PM
Err..so sorry, mate,
but how do I reference to the DLL?
I've thought of another "primitive" method,
what I did was, I split the string based of vbcrlf,
i.e. Lines = Split(abcstring, vbCrLf)
then I used a for loop to join them...
the arrays of strings (Lines) up.
May 30th, 2002, 10:39 PM
Then select the dll I posted earlier
NOTE - If you're using SourceSafe, you must check out your project file first.
May 30th, 2002, 11:18 PM
Private Sub Command1_Click()
Dim Lines As Variant
Lines = Split(abcstring, vbCrLf)
MsgBox Join(Lines, "")
Click Here to Expand Forum to Full Width