There are various ways to do this.
A straightforward one is to create a new string step by step while looping over the array of TranslateArrayResponse
values - according to the docs, each of them has a TranslatedText
property of type string
:
StringBuilder sb = new StringBuilder();
foreach (var tar in result) {
sb.Append(tar.TranslatedText);
}
string resultString = sb.ToString();
Another solution is to use the LINQ Select
method to extract the translated text from each item and then the string.Join
method to concatenate the result enumeration of strings:
string resultString = string.Join("", result.Select(r => r.TranslatedText));