字符串操作大全

去除首字符

1.json = json.Substring(1, json.Length-1);

2.strInfo = strInfo.Remove(0, 1);

去除尾字符

1.json = json.Substring(0,json.Length-1);


2.strInfo = strInfo.Remove(strInfo.Length - 1, 1);

 

字符串数组变成带","的字符串

string.Join(",", detailModel.Select(it => it.Id.ToString()).ToList());

posted @ 2019-05-23 11:44  Agreoself  阅读(84)  评论(0编辑  收藏  举报