I’m having an array of individual strings.
Basically, these are ascii codes converted to a string.
a = a counter
str(char(txtArray[a]))
I could add all strings from the array to a single string ‘ab’ like the following line but this of course, is not practical:
tring ab = str(char(txtArray[1]))+ str(char(txtArray[2]))+ str(char(txtArray[3]));
println(ab);
I tried different methods, using append(), join() from the processing examples, but I just can’t wrap my head around it to make it work. The ‘append’ example here results in an error:
“Type String of the last argument to method(object) doesn’t exactly match the vararg parameter type. Cast to Object to confirm the non-varargs invocation, or pass individual arguments of type object for a varargs invocation.”
How can I add individual strings from an array to a single string?
Here’s the code in my program:
for(int a = 1; a < txtCount+1; a++){
// StringList ab;
text (char(txtArray[a]),(100+(12*a)),100); // writing to the screen.
String ab = str(char(txtArray[1]))+ str(char(txtArray[2]))+ str(char(txtArray[3]));
println(ab);
}