我有List<string> num
。根据num的数量,我需要构建一个字符串,如:
如果num由561924630638
{"formType":"Status", "postDataList":[{"textWithMentions":{"text":"gogogo"}},{"imageData":{"imageIds":["561924630638"], "typeAndSizes":["561924630638,0,300,290"]}}], "news":false, "toStatus":true}
如果num由561924630638
和561924630894
{"formType":"Status", "postDataList":[{"textWithMentions":{"text":"gogogo"}},{"imageData":{"imageIds":["561924630638","561924630894"], "typeAndSizes":["561924630638,0,300,290","561924630894,0,300,290"]}}], "news":false, "toStatus":true}
答案 0 :(得分:0)
List<string> _num;
List<string> num
{
get
{
return _num;
}
set
{
_num = value;
// Check the value here and do what you need
if (_num.Contains("561924630638"))
{ }
else if (_num.Contains("561924630638") && _num.Contains("561924630894"))
{ }
}
}