Asp.net core 如何在.Net核心wep api中将列表中的行文本转换为成功文本消息

Asp.net core 如何在.Net核心wep api中将列表中的行文本转换为成功文本消息,asp.net-core,rows,concat,Asp.net Core,Rows,Concat,将列表中的文本转换成.Net核心wep api中的成功文本msg与WebAPI本身无关。这更像是一个框架问题。使用string.Join(分隔符,ienumerable) 然而,这里有一个例子: [Route("api/[controller]")] public class DemoController : Controller { [HttpGet] public IActionResult Get() { var listOfMessages = n

将列表中的文本转换成.Net核心wep api中的成功文本msg与WebAPI本身无关。这更像是一个框架问题。使用string.Join(分隔符,ienumerable)

然而,这里有一个例子:

[Route("api/[controller]")]
public class DemoController : Controller
{
    [HttpGet]
    public IActionResult Get()
    {
        var listOfMessages = new[] {"these", "should", "be", "combined"};
        var result = string.Join(' ', listOfMessages);
        return Ok(result);
    }
}
结果如下所示:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Tue, 22 May 2018 10:59:38 GMT
Content-Length: 24

these should be combined