Example:
string x;
string[] y = {"5", "0","0","5","5"};
x = "50055"
I want to put everything together into one variable. I will store in a non-print variable.
Example:
string x;
string[] y = {"5", "0","0","5","5"};
x = "50055"
I want to put everything together into one variable. I will store in a non-print variable.
You can use String.Join
when you need a separator. So:
string[] nomes = {"Vinicius", "Rovann", "Anderson"};
return string.Join(";", nomes);
// Saída: "Vinicius;Rovann;Anderson"
If you want to concatenate an array of strings in a single string, you can use String.Concat
. See:
string[] arr = {"1", "2", "3"};
return string.Concat(arr);
// Saída: "123"