Answer the question
In order to leave comments, you need to log in
How to join from an array, after converting each element?
I have the following loop
r = "";
foreach( var t in arr )
r += "text=" + t + ",";
String.Join( "text=", arr );
r = r.SubString( 0, r.Length-1 );
for( int i = 0; i < arr.Length; i++ )
r += "text" + t + (i == arr.Length-1 ? "" : "," );
Answer the question
In order to leave comments, you need to log in
string[] arr = new[] { "1", "2" };
var result = string.Join(",", arr.Select(v => $"text={v}"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question