Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string strgroupids = "6";
- groupIds.ForEach((g) =>
- {
- strgroupids = strgroupids + g.ToString() + ",";
- strgroupids.TrimEnd(',');
- });
- strgroupids.TrimEnd(new char[] { ',' });
- strgroupids = strgroupids.Remove(strgroupids.Length - 1);
- strgroupids = string.Join( ",", groupIds );
- public static string RemoveLast(this string text, string character)
- {
- if(text.Length < 1) return text;
- return text.Remove(text.ToString().LastIndexOf(character), character.Length);
- }
- yourString.RemoveLast(",");
- while (strgroupids.EndsWith(","))
- strgroupids = strgroupids.Substring(0, strgroupids.Length - 1);
- var strgroupids = String.Join(",", groupIds);
- string strgroupids = string.Empty;
- groupIds.ForEach(g =>
- {
- strgroupids = strgroupids + g.ToString() + ",";
- });
- strgroupids = strgroupids.Substring(0, strgroupids.Length - 1);
- string strgroupids = groupIds.Aggregate(string.Empty, (p, q) => p + q + ',');
- strgroupids = strgroupids.Substring(0, str1.Length - 1);
- string strgroupids = groupIds.Aggregate(string.Empty, (p, q) => (p != string.Empty ? p + "," + q : q.ToString()));
- strgroupids = strgroupids.Remove(strgroupids.Trim().Length - 1);
- var strgroupids = string.Empty;
- groupIds.ForEach(g =>
- {
- if(strgroupids != string.Empty){
- strgroupids += ",";
- }
- strgroupids += g;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement