Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. string strgroupids = "6";
  2.  
  3. groupIds.ForEach((g) =>
  4. {
  5. strgroupids = strgroupids + g.ToString() + ",";
  6. strgroupids.TrimEnd(',');
  7. });
  8.  
  9. strgroupids.TrimEnd(new char[] { ',' });
  10.  
  11. strgroupids = strgroupids.Remove(strgroupids.Length - 1);
  12.  
  13. strgroupids = string.Join( ",", groupIds );
  14.  
  15. public static string RemoveLast(this string text, string character)
  16. {
  17. if(text.Length < 1) return text;
  18. return text.Remove(text.ToString().LastIndexOf(character), character.Length);
  19. }
  20.  
  21. yourString.RemoveLast(",");
  22.  
  23. while (strgroupids.EndsWith(","))
  24. strgroupids = strgroupids.Substring(0, strgroupids.Length - 1);
  25.  
  26. var strgroupids = String.Join(",", groupIds);
  27.  
  28. string strgroupids = string.Empty;
  29.  
  30. groupIds.ForEach(g =>
  31. {
  32. strgroupids = strgroupids + g.ToString() + ",";
  33. });
  34.  
  35. strgroupids = strgroupids.Substring(0, strgroupids.Length - 1);
  36.  
  37. string strgroupids = groupIds.Aggregate(string.Empty, (p, q) => p + q + ',');
  38. strgroupids = strgroupids.Substring(0, str1.Length - 1);
  39.  
  40. string strgroupids = groupIds.Aggregate(string.Empty, (p, q) => (p != string.Empty ? p + "," + q : q.ToString()));
  41.  
  42. strgroupids = strgroupids.Remove(strgroupids.Trim().Length - 1);
  43.  
  44. var strgroupids = string.Empty;
  45.  
  46. groupIds.ForEach(g =>
  47. {
  48. if(strgroupids != string.Empty){
  49. strgroupids += ",";
  50. }
  51.  
  52. strgroupids += g;
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement