Last active
November 7, 2023 21:08
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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