giannik wrote:
I am using this function :
Dim ArrColWidths() As String
ArrColWidths = Split(string.empty,";")
This always returns an array with 1 element .
Silly in my opinion.
But exactly as documented:
>>
If Expression is a zero-length string (""), Split returns a
single-element array containing a zero-length string. If Delimiter is a
zero-length string, or if it does not appear anywhere in Expression,
Split returns a single-element array containing the entire Expression
string.
>>
In fact the first case here is covered by the second case; it's just
listed explicitly for ... well, explicitness, I suppose.
>
Is there a way around this so that it returns an array with zero elements ?
Wrap it in your own function that does what you want.
What would you want Split("banana", ";") to return, incidentally ?
--
Larry Lard
Replies to group please
When starting a new topic, please mention which version of VB/C# you
are using