[Gambas-user] Accessing characters of string as array

T Lee Davidson t.lee.davidson at gmail.com
Mon Nov 18 03:27:58 CET 2019


The documentation for Mid() [0] says:
Using string like arrays (as known as "Boxed strings")
SINCE 3.12
You can get the contents of a string using the following array-like syntax:


Result = String [ Start As Integer [ , Length As Integer ] ]
--- end quote ---

Nice. But the following causes the exception, "Not an object":
Public Sub Main()

   Dim s As String = "123456789"

   Print s[3, 1]

End


Is this a bug, or am I misunderstanding the documentation?


___
Lee

[0] http://gambaswiki.org/wiki/lang/mid


More information about the User mailing list