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

Martín mbelmonte at belmotek.net
Thu Nov 23 13:05:42 CET 2023


El 23/11/23 a las 12:32, BB escribió:
> I have not been successful trying the same. The native[] classes seem 
> to be a bit different. 

Exactly, the Class String[] seems to be different.

I extend perfectly tha clas String using thismethod.

I create a class names String.class in my project, then inside this i 
put some code like the follow:

' Gambas class file

Export

Static Public Function Aleph(z As Integer) As String

   Dim sWord As String
   Dim r As Integer

   For r = 1 To z
     sWord &= Chr(Rand(65, 90))
   Next

   Return sWord

End

Then I get the new method "Aleph" in in the native class String. its act 
the same that the class util.class  that extend String adding 
RemoveDiacritics() method etc.

But How to extend String[] is a mystery for me.

Martín.



More information about the User mailing list