【发布时间】:2016-08-26 05:56:44
【问题描述】:
我将 Json 数组作为列表传递给 MVC 控制器。如何使用 linq 从列表中的列中删除空格?我的 json 数组如下所示。
var Refresh = function () {
var Product = [
{
ProductCode: 'P 1',
ProductName: 'P1Name',
ProductType: "T1",
Amount: "2000"
},
{
ProductCode: 'P4',
ProductName: 'P4 Name',
ProductType: "T4",
Amount: "2000"
},
{
ProductCode: 'P2',
ProductName: 'P2Name',
ProductType: "T2",
Amount: "2000"
}
]
在上面的数组中,删除 ProductCode 'P 1' 到 'P1' 和 ProductName 'P4 Name' 到 'P4Name' 的空格。
【问题讨论】:
-
你应该先尝试一下
-
也许他是想看看一些变化。如果写得很清楚,我看不出有任何理由拒绝初学者的问题。
-
以上函数是javascript没有??
标签: c# json asp.net-mvc linq