Hello,
I try to add / insert / remove a row in a list after using Regex.Split, but I probably don't use the commands correctly as I get following error message:
java.lang.UnsupportedOperationException
Here is the code:
Following code works correctly (no use of Regex.Split):
What is wrong with Regex.Split?
I try to add / insert / remove a row in a list after using Regex.Split, but I probably don't use the commands correctly as I get following error message:
java.lang.UnsupportedOperationException
Here is the code:
B4X:
Dim Str_Msg As String
Str_Msg = "123;456;789"
Dim List_Msg As List
List_Msg.Initialize
List_Msg = Regex.Split(";", Str_Msg)
InputList(List_Msg, "List", -1) ' => This works correctly ( 123 / 456 / 789 )
List_Msg.Add("Extra row") ' => Error message
InputList(List_Msg, "List", -1)
' Insert first row
' List_Msg.InsertAt(0, "This is the new first row") ' => Error message
' Str_Msg = "This is the new first row"
' List_Msg.InsertAt(0, Str_Msg)
' InputList(List_Msg, "List", -1)
' Remove first row
' List_Msg.RemoveAt(1) ' => Error message
' InputList(List_Msg, "List", -1)
Following code works correctly (no use of Regex.Split):
B4X:
Dim List_Msg As List
List_Msg.Initialize
List_Msg.Add("1")
List_Msg.Add("2")
List_Msg.Add("3")
InputList(List_Msg, "List", -1) ' => OK
List_Msg.Add("4")
InputList(List_Msg, "List", -1) ' => OK
List_Msg.InsertAt(0, "This is the new first row")
InputList(List_Msg, "List", -1) ' => OK
List_Msg.RemoveAt(0)
InputList(List_Msg, "List", -1) ' => OK
What is wrong with Regex.Split?