1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 03:45:41 +00:00
X10D/api/X10D.Collections.ListExtensions.html
2024-06-12 13:17:02 +00:00

901 lines
41 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class ListExtensions
| X10D </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class ListExtensions
| X10D ">
<meta name="generator" content="docfx 2.56.7.0">
<link rel="shortcut icon" href="../images/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/night-owl.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="../styles/config.css">
<link rel="stylesheet" href="../styles/discord.css">
<link rel="stylesheet" href="../styles/singulink.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
<meta property="docfx:newtab" content="true">
</head>
<body>
<div class="top-navbar">
<a class="burger-icon" onclick="toggleMenu()">
<svg name="Hamburger" style="vertical-align: middle;" width="34" height="34" viewbox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M20 6H4V9H20V6ZM4 10.999H20V13.999H4V10.999ZM4 15.999H20V18.999H4V15.999Z"></path></svg>
</a>
<a class="brand" href="../index.html">
<img src="../images/favicon.png" alt="X10D" class="logomark">
<span class="brand-title">X10D</span>
</a> </div>
<div class="body-content">
<div id="blackout" class="blackout" onclick="toggleMenu()"></div>
<nav id="sidebar" role="navigation">
<div class="sidebar">
<div>
<div class="mobile-hide">
<a class="brand" href="../index.html">
<img src="../images/favicon.png" alt="X10D" class="logomark">
<span class="brand-title">X10D</span>
</a> </div>
<div class="sidesearch">
<form id="search" role="search" class="search">
<i class="bi bi-search search-icon"></i>
<input type="text" id="search-query" placeholder="Search" autocomplete="off">
</form>
</div>
<div id="navbar">
</div>
</div> <div class="sidebar-item-separator"></div>
<div id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="footer">
<strong>DocFX + Singulink = ♥</strong>
</div> </nav>
<main class="main-panel">
<div id="search-results" style="display: none;">
<h1 class="search-list">Search Results for <span></span></h1>
<div class="sr-items">
<p><i class="bi bi-hourglass-split index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
<div role="main" class="hide-when-search">
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
<article class="content wrap" id="_content" data-uid="X10D.Collections.ListExtensions">
<h1 id="X10D_Collections_ListExtensions" data-uid="X10D.Collections.ListExtensions" class="text-break">Class ListExtensions
</h1>
<div class="markdown level0 summary"><p>Extension methods for <see cref="!:IList&lt;T>"></see> and <see cref="!:IReadOnlyList&lt;T>"></see>.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">ListExtensions</span></div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="X10D.Collections.html">X10D.Collections</a></h6>
<h6><strong>Assembly</strong>: X10D.dll</h6>
<h5 id="X10D_Collections_ListExtensions_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class ListExtensions : object</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Fill__1_IList___0____0_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Fill%60%601(IList%7B%60%600%7D%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L20">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Fill_" data-uid="X10D.Collections.ListExtensions.Fill*"></a>
<h4 id="X10D_Collections_ListExtensions_Fill__1_IList___0____0_" data-uid="X10D.Collections.ListExtensions.Fill``1(IList{``0},``0)">Fill&lt;T&gt;(IList&lt;T&gt;, T)</h4>
<div class="markdown level1 summary"><p>Assigns the given value to each element of the list.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void Fill&lt;T&gt;(this IList&lt;T&gt; source, T value)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to be filled.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">value</span></td>
<td><p>The value to assign to each list element.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of the elements in the list.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Fill__1_IList___0____0_System_Int32_System_Int32_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Fill%60%601(IList%7B%60%600%7D%2C%60%600%2CSystem.Int32%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L50">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Fill_" data-uid="X10D.Collections.ListExtensions.Fill*"></a>
<h4 id="X10D_Collections_ListExtensions_Fill__1_IList___0____0_System_Int32_System_Int32_" data-uid="X10D.Collections.ListExtensions.Fill``1(IList{``0},``0,System.Int32,System.Int32)">Fill&lt;T&gt;(IList&lt;T&gt;, T, Int32, Int32)</h4>
<div class="markdown level1 summary"><p>Assigns the given value to the elements of the list which are within the range of <code data-dev-comment-type="paramref" class="paramref">startIndex</code>
(inclusive) and the next <code data-dev-comment-type="paramref" class="paramref">count</code> number of indices.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void Fill&lt;T&gt;(this IList&lt;T&gt; source, T value, int startIndex, int count)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to be filled.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">value</span></td>
<td><p>The value to assign to each list element.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">startIndex</span></td>
<td><p>A 32-bit integer that represents the index in the list at which filling begins.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">count</span></td>
<td><p>The number of elements to fill.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of the elements in the list.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.IndexOf%60%601(IReadOnlyList%7B%60%600%7D%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L98">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_IndexOf_" data-uid="X10D.Collections.ListExtensions.IndexOf*"></a>
<h4 id="X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_" data-uid="X10D.Collections.ListExtensions.IndexOf``1(IReadOnlyList{``0},``0)">IndexOf&lt;T&gt;(IReadOnlyList&lt;T&gt;, T)</h4>
<div class="markdown level1 summary"><p>Searches for the specified object and returns the zero-based index of the first occurrence within the entire
<see cref="!:IReadOnlyList&lt;T>"></see>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int IndexOf&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, T item)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to search</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>The object to locate in the <see cref="!:IReadOnlyList&lt;T>"></see>. The value can be <span class="xref">true</span> for reference
types.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><p>The zero-based index of the first occurrence of item within the entire <see cref="!:List&lt;T>"></see>, if found; otherwise,
-1.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_System_Int32_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.IndexOf%60%601(IReadOnlyList%7B%60%600%7D%2C%60%600%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L127">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_IndexOf_" data-uid="X10D.Collections.ListExtensions.IndexOf*"></a>
<h4 id="X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_System_Int32_" data-uid="X10D.Collections.ListExtensions.IndexOf``1(IReadOnlyList{``0},``0,System.Int32)">IndexOf&lt;T&gt;(IReadOnlyList&lt;T&gt;, T, Int32)</h4>
<div class="markdown level1 summary"><p>Searches for the specified object and returns the zero-based index of the first occurrence within the range of
elements in the <see cref="!:IReadOnlyList&lt;T>"></see> that extends from the specified index to the last element.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int IndexOf&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, T item, int startIndex)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to search</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>The object to locate in the <see cref="!:IReadOnlyList&lt;T>"></see>. The value can be <span class="xref">true</span> for reference
types.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">startIndex</span></td>
<td><p>The zero-based starting index of the search. 0 (zero) is valid in an empty list.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><p>The zero-based index of the first occurrence of item within the range of elements in the
<see cref="!:IReadOnlyList&lt;T>"></see> that starts at index and contains count number of elements, if found; otherwise, -1.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_System_Int32_System_Int32_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.IndexOf%60%601(IReadOnlyList%7B%60%600%7D%2C%60%600%2CSystem.Int32%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L167">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_IndexOf_" data-uid="X10D.Collections.ListExtensions.IndexOf*"></a>
<h4 id="X10D_Collections_ListExtensions_IndexOf__1_IReadOnlyList___0____0_System_Int32_System_Int32_" data-uid="X10D.Collections.ListExtensions.IndexOf``1(IReadOnlyList{``0},``0,System.Int32,System.Int32)">IndexOf&lt;T&gt;(IReadOnlyList&lt;T&gt;, T, Int32, Int32)</h4>
<div class="markdown level1 summary"><p>Searches for the specified object and returns the zero-based index of the first occurrence within the range of
elements in the <see cref="!:IReadOnlyList&lt;T>"></see> that starts at the specified index and contains the specified number
of elements.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int IndexOf&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, T item, int startIndex, int count)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to search</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>The object to locate in the <see cref="!:IReadOnlyList&lt;T>"></see>. The value can be <span class="xref">true</span> for reference
types.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">startIndex</span></td>
<td><p>The zero-based starting index of the search. 0 (zero) is valid in an empty list.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">count</span></td>
<td><p>The number of elements in the section to search.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><p>The zero-based index of the first occurrence of item within the range of elements in the
<see cref="!:IReadOnlyList&lt;T>"></see> that starts at index and contains count number of elements, if found; otherwise, -1.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Random__1_IReadOnlyList___0__System_Nullable_Random__.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Random%60%601(IReadOnlyList%7B%60%600%7D%2CSystem.Nullable%7BRandom%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L213">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Random_" data-uid="X10D.Collections.ListExtensions.Random*"></a>
<h4 id="X10D_Collections_ListExtensions_Random__1_IReadOnlyList___0__System_Nullable_Random__" data-uid="X10D.Collections.ListExtensions.Random``1(IReadOnlyList{``0},System.Nullable{Random})">Random&lt;T&gt;(IReadOnlyList&lt;T&gt;, Nullable&lt;Random&gt;)</h4>
<div class="markdown level1 summary"><p>Returns a random element from the current list using a specified <see cref="!:System.Random"></see> instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T Random&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, Random? random = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The source collection from which to draw.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Nullable</span>&lt;<span class="xref">Random</span>&gt;</td>
<td><span class="parametername">random</span></td>
<td><p>The <see cref="!:System.Random"></see> instance to use for the shuffling. If <span class="xref">null</span> is specified, a shared
instance is used.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p>A random element of type <code data-dev-comment-type="typeparamref" class="typeparamref">T</code> from <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The element type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Collections_ListExtensions_Random__1_IReadOnlyList___0__System_Nullable_Random___examples">Examples</h5>
<pre><code>var list = new List&lt;int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var number = list.Random();</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_RemoveRange__1_IList___0__Range_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.RemoveRange%60%601(IList%7B%60%600%7D%2CRange)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L237">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_RemoveRange_" data-uid="X10D.Collections.ListExtensions.RemoveRange*"></a>
<h4 id="X10D_Collections_ListExtensions_RemoveRange__1_IList___0__Range_" data-uid="X10D.Collections.ListExtensions.RemoveRange``1(IList{``0},Range)">RemoveRange&lt;T&gt;(IList&lt;T&gt;, Range)</h4>
<div class="markdown level1 summary"><p>Removes a range of elements from the list.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void RemoveRange&lt;T&gt;(this IList&lt;T&gt; source, Range range)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list whose elements to remove.</p>
</td>
</tr>
<tr>
<td><span class="xref">Range</span></td>
<td><span class="parametername">range</span></td>
<td><p>The range of elements to remove.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of the elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Shuffle__1_IList___0__System_Nullable_Random__.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Shuffle%60%601(IList%7B%60%600%7D%2CSystem.Nullable%7BRandom%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L262">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Shuffle_" data-uid="X10D.Collections.ListExtensions.Shuffle*"></a>
<h4 id="X10D_Collections_ListExtensions_Shuffle__1_IList___0__System_Nullable_Random__" data-uid="X10D.Collections.ListExtensions.Shuffle``1(IList{``0},System.Nullable{Random})">Shuffle&lt;T&gt;(IList&lt;T&gt;, Nullable&lt;Random&gt;)</h4>
<div class="markdown level1 summary"><p>Reorganizes the elements in a list by implementing a Fisher-Yates shuffle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void Shuffle&lt;T&gt;(this IList&lt;T&gt; source, Random? random = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The <see cref="!:IList&lt;T>"></see> to shuffle.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Nullable</span>&lt;<span class="xref">Random</span>&gt;</td>
<td><span class="parametername">random</span></td>
<td><p>The <see cref="!:System.Random"></see> instance to use for the shuffling. If <span class="xref">null</span> is specified, a shared
instance is used.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The element type.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Slice__1_IReadOnlyList___0__System_Int32_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Slice%60%601(IReadOnlyList%7B%60%600%7D%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L292">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Slice_" data-uid="X10D.Collections.ListExtensions.Slice*"></a>
<h4 id="X10D_Collections_ListExtensions_Slice__1_IReadOnlyList___0__System_Int32_" data-uid="X10D.Collections.ListExtensions.Slice``1(IReadOnlyList{``0},System.Int32)">Slice&lt;T&gt;(IReadOnlyList&lt;T&gt;, Int32)</h4>
<div class="markdown level1 summary"><p>Forms a slice out of the current list that begins at a specified index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IReadOnlyList&lt;T&gt; Slice&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, int start)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to slice.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">start</span></td>
<td><p>The index at which to begin the slice.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><p>A list that consists of all elements of the current list from <code data-dev-comment-type="paramref" class="paramref">start</code> to the end of the list.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Slice__1_IReadOnlyList___0__System_Int32_System_Int32_.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Slice%60%601(IReadOnlyList%7B%60%600%7D%2CSystem.Int32%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L317">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Slice_" data-uid="X10D.Collections.ListExtensions.Slice*"></a>
<h4 id="X10D_Collections_ListExtensions_Slice__1_IReadOnlyList___0__System_Int32_System_Int32_" data-uid="X10D.Collections.ListExtensions.Slice``1(IReadOnlyList{``0},System.Int32,System.Int32)">Slice&lt;T&gt;(IReadOnlyList&lt;T&gt;, Int32, Int32)</h4>
<div class="markdown level1 summary"><p>Forms a slice out of the current list that begins at a specified index for a specified length.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IReadOnlyList&lt;T&gt; Slice&lt;T&gt;(this IReadOnlyList&lt;T&gt; source, int start, int length)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The list to slice.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">start</span></td>
<td><p>The index at which to begin the slice.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">length</span></td>
<td><p>The desired length for the slice.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IReadOnlyList</span>&lt;T&gt;</td>
<td><p>A list that consists of all elements of the current list from <code data-dev-comment-type="paramref" class="paramref">start</code> to the end of the list.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of elements in <code data-dev-comment-type="paramref" class="paramref">source</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Collections_ListExtensions_Swap__1_IList___0__IList___0__.md&amp;value=---%0Auid%3A%20X10D.Collections.ListExtensions.Swap%60%601(IList%7B%60%600%7D%2CIList%7B%60%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Collections/ListExtensions.cs/#L356">View Source</a>
</span>
<a id="X10D_Collections_ListExtensions_Swap_" data-uid="X10D.Collections.ListExtensions.Swap*"></a>
<h4 id="X10D_Collections_ListExtensions_Swap__1_IList___0__IList___0__" data-uid="X10D.Collections.ListExtensions.Swap``1(IList{``0},IList{``0})">Swap&lt;T&gt;(IList&lt;T&gt;, IList&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Swaps all elements in a list with the elements in another list.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void Swap&lt;T&gt;(this IList&lt;T&gt; source, IList&lt;T&gt; other)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">source</span></td>
<td><p>The first list.</p>
</td>
</tr>
<tr>
<td><span class="xref">IList</span>&lt;T&gt;</td>
<td><span class="parametername">other</span></td>
<td><p>The second list.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>The type of the elements in <code data-dev-comment-type="paramref" class="paramref">source</code> and <code data-dev-comment-type="paramref" class="paramref">other</code>.</p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="copyright-footer">
<span>&#169; Singulink. All rights reserved.</span>
</div>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<script type="text/javascript" src="../styles/jquery.twbsPagination.js"></script>
<script type="text/javascript" src="../styles/url.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/singulink.js"></script>
<script type="text/javascript" src="../styles/main.js"></script> </body>
</html>