I want to convert Array into string as
string[] parts={"1","2","3","4"};
and output as
string str="%1%2%3%4%";
Use string.Join:
var str = string.Join("%", parts);
And add in the surrounding % marks:
str = string.format("%{0}%", str);
Using C#-6 string interpolation:
var str = $"%{string.Join("%", parts)}%";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With