mirror of
https://github.com/Stone-Red-Code/Stone_Red-C-Sharp-Utilities.git
synced 2026-09-08 17:36:00 +02:00
Created CollectionExtentions (markdown)
@@ -0,0 +1,46 @@
|
|||||||
|
# Stone_Red_Utilities.CollectionExtentions
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
* Print\<T>
|
||||||
|
* Description: Prints items of an IEnumerable\<T>
|
||||||
|
* Parameters: `this IEnumerable<T> collection`, `char delimiter`, `bool printToDebugConsole`
|
||||||
|
* Example usage:
|
||||||
|
|
||||||
|
```cs
|
||||||
|
string[] yourArray = { "str1", "str2", "str3" };
|
||||||
|
yourArray.Print(';');
|
||||||
|
```
|
||||||
|
|
||||||
|
* Output:
|
||||||
|
|
||||||
|
```text
|
||||||
|
str1; str2; str3
|
||||||
|
```
|
||||||
|
|
||||||
|
* PrintTable\<T>
|
||||||
|
* Description: Creates and prints table from 2D array
|
||||||
|
* Parameters: `this T[,] array`, `TableStyle tableStyle`
|
||||||
|
* Example usage:
|
||||||
|
|
||||||
|
```cs
|
||||||
|
int[,] your2dArray =
|
||||||
|
{
|
||||||
|
{1,2,3 },
|
||||||
|
{4,5,6 },
|
||||||
|
{7,8,9 }
|
||||||
|
};
|
||||||
|
your2dArray.PrintTable(TableStyle.Default);
|
||||||
|
```
|
||||||
|
|
||||||
|
* Output:
|
||||||
|
|
||||||
|
```text
|
||||||
|
-------------
|
||||||
|
| 1 | 2 | 3 |
|
||||||
|
-------------
|
||||||
|
| 4 | 5 | 6 |
|
||||||
|
-------------
|
||||||
|
| 7 | 8 | 9 |
|
||||||
|
-------------
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user