Gambas, Split string by character and add into array

1.3k Views Asked by At

So I've got this code in Gambas 3 on Debian 8 to split a string into characters, when executed it says, that there

Eingabe and buchstaben are both declared as strings, while buchstaben is an array.

Public buchstaben As String[]
Public Eingabe As String



Eingabe = LCase(T1.Text)

For j = 0 To (Len(Eingabe) - 1)
  buchstaben.Add(Mid(Eingabe, i, 1))
  i += 1
Next

T1 is a Textbox, which takes strings.

1

There are 1 best solutions below

1
alsternerd On

I got the Solution myself now. I need to add

buchstaben = New String[]

into the function, before I use the array for some reason.