[Gambas-user] How to extend the String[] class ??

T Lee Davidson t.lee.davidson at gmail.com
Thu Nov 23 22:56:58 CET 2023


On 11/23/23 12:19, Bruce Steers wrote:
> 
> 
> On Thu, 23 Nov 2023 at 16:55, T Lee Davidson <t.lee.davidson at gmail.com <mailto:t.lee.davidson at gmail.com>> wrote:
> 
> 
>     Public Sub Squash() As String[]
> 
>         Return Split(Super.Join(","), ",", Null, True) ' I like that code, Guianluigi; very slick.
> 
>     End
> 
> 
> That's not going to work if any strings have a comma in them though.

That's true. I suppose one could use a demarcation character that is highly unlikely to be in a string:

   Return Split(Super.Join(Chr(31)), Chr(31), Null, True)
or,
   Return Split(Super.Join(Chr(0)), Chr(0), Null, True)


-- 
Lee



More information about the User mailing list