John said:
I have a multi-line address field which has each line separated by CRLF. How
can I split this field into individual strings using crlf as separator?
For VB 2003, you /have/ to use
Microsoft.VisualBasic.Strings.Split( s, vbCrLf )
Dim x as String _
= "X,Y,Z".Replace( ".", vbCrlf )
? Microsoft.VisualBasic.Strings.Split( x, vbCrLf ).Length
3
The String.Split method /does not/ cater for multiple-character
delimiters, only working with lists of characters, each of which it
treats as a separate delimiter, leaving you with lots of blank entries
in the resulting array).
? String.Split( x, vbCr, vbLf ).Length
5
VB 2005 has a [more] sensible String.Split method that can handle
multiple-character delimiters.
? String.Split( x, New String() { vbCrLf } ).Length
3
HTH,
Phill W.