Skip to content

Instantly share code, notes, and snippets.

@STOL4S
Last active November 7, 2023 21:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save STOL4S/7e175b0e6c8080550c9b0daccb8f931d to your computer and use it in GitHub Desktop.
This function allows for the input of any IList and outputs a formatted, readable string.
using System;
using System.Collections;
namespace ExtLibrary
{
public static class ListExtensions
{
public static string AsString(this IList _List)
{
string _Buffer = "";
for (int x = 0; x < _List.Count; x++)
{
_Buffer += x == _List.Count - 1 ? _List[x] : _List[x] + ", ";
}
return _Buffer;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment