How would you concatenate an array of strings together?
If you need delimiters between each string (such as comma separating a list), there is string.Join.
If you want to run a function on each string before joining them, you can do: string.Join(separator, yourArrayOrCollection.Select(x => Operation(x));
If you want any kind of fancier operation, a StringBuilder and a loop might be the best approach.
char buffer[4096]; // adjust
buffer[0]='\0';
for(int i=0;i<array_size;i++){
strcat(buffer,string_array);
}
You can implement a two pass system as well, the first pass can determine how big the buffer must be.
char buffer[4096]; // adjust buffer[0]='\0'; for(int i=0;i<array_size;i++){ strcat(buffer,string_array); }
You can implement a two pass system as well, the first pass can determine how big the buffer must be.
I want to provide constructive criticism to say why you are getting downvotes, because it is frustrating to receive a negative reputation with out explanation.
That is the wrong language; there is no strcat() that I'm aware of in C#, and character arrays are not what is being used. That's also one of the least efficient ways to concatenate a collection of strings, due to having to count the length of the buffer each time you concatenate the string, which takes longer and longer.
char buffer[4096]; // adjust buffer[0]='\0'; for(int i=0;i<array_size;i++){ strcat(buffer,string_array); }
You can implement a two pass system as well, the first pass can determine how big the buffer must be.
I want to provide constructive criticism to say why you are getting downvotes, because it is frustrating to receive a negative reputation with out explanation.
That is the wrong language; there is no strcat() that I'm aware of in C#, and character arrays are not what is being used. That's also one of the least efficient ways to concatenate a collection of strings, due to having to count the length of the buffer each time you concatenate the string, which takes longer and longer.
Thank you. I didn't see the C# icon until just now.