Hi, I have a variable x of type String. How do I concatenate a new inner array to x? I tried using the assign activity where I assign x = x.Concat({“string1”, “string2”}).ToArray but I am facing the above issue that type String cannot be converted to String(). How do I solve this error, or is there another method to concatenate a new array of strings to my variable x?
example:
x = [[“a”, “b”], [“c”, “d”]]
x += [“e”, “f”]
printing x returns [[“a”, “b”], [“c”, “d”], [“e”, “f”]]
both the .Append and .Concat method are able to compile, but when I debug the file, it gives me the error that I cannot assign 'x.Append({“e”, “f”}).ToArray to x.
however, if I swap out x and use {({“a”, “b”}), ({“c”, “d”})}.Append({“e”, “f”}).ToArray, I am able to compile and debug the file without any errors. this means that there is something wrong with x? but the variable x has a variable type String[][] or array of array of strings. what could be the issue then?
may I also know how you open that ‘Immediate’ console? the documentation says that the Immediate panel is only visible during debugging but I don’t see it.
and after I assigned “{({“a”, “b”}), ({“c”, “d”})}.Append({“e”, “f”}).ToArray” to y, I tried to print the inner array by doing the following:
using the For Each activity, for each currentItem in y
use Message Box activity to print String.Join(“,”, currentItem)
but this just prints out “System.String[ ]”. how can I print for example “{“a”, “b”}” or “a, b” for each iteration of the inner array?
hi, I tried this and I get the compile error that value of type String (,) cannot be converted to String() because the array types have different number of dimensions
thank you for sharing the link on debugging panels.
I realised that my x variable was null at initially hence I was unable to append to it. Instead of a String[ ][ ], I think it would be better to use a List<List<String_>_>, as in a List of List of String. However, under the variables panel, I tried to set the default value to New List(Of (New List(Of String))), but got a few errors stating that New is not valid in this context, and the value of type ‘List(Of(?,?))’ cannot be converted to List(Of List(Of String)). If that’s the case, how do i instantiate an empty list of list of string?