-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathArrayList.xml
More file actions
4487 lines (4020 loc) · 276 KB
/
ArrayList.xml
File metadata and controls
4487 lines (4020 loc) · 276 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="ArrayList" FullName="System.Collections.ArrayList">
<TypeSignature Language="C#" Value="public class ArrayList : System.Collections.IList" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ArrayList extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.Collections.IList" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1" />
<TypeSignature Language="DocId" Value="T:System.Collections.ArrayList" />
<TypeSignature Language="VB.NET" Value="Public Class ArrayList
Implements IList" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1" />
<TypeSignature Language="F#" Value="type ArrayList = class
 interface IEnumerable
 interface IList
 interface ICollection" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1" />
<TypeSignature Language="C++ CLI" Value="public ref class ArrayList : System::Collections::IList" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1" />
<TypeSignature Language="C#" Value="public class ArrayList : ICloneable, System.Collections.IList" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ArrayList extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.Collections.IList, class System.ICloneable" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="VB.NET" Value="Public Class ArrayList
Implements ICloneable, IList" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="F#" Value="type ArrayList = class
 interface ICollection
 interface IEnumerable
 interface IList
 interface ICloneable" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="C++ CLI" Value="public ref class ArrayList : ICloneable, System::Collections::IList" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="F#" Value="type ArrayList = class
 interface IEnumerable
 interface IList
 interface ICollection
 interface ICloneable" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit ArrayList extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.Collections.IList, class System.ICloneable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<TypeSignature Language="F#" Value="type ArrayList = class
 interface IList
 interface ICollection
 interface IEnumerable
 interface ICloneable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="10.0.0.0" To="System.Runtime" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="10.0.0.0" To="System.Runtime" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="11.0.0.0" To="System.Runtime" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="11.0.0.0" To="System.Runtime" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="5.0.0.0" To="System.Runtime" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="5.0.0.0" To="System.Runtime" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="6.0.0.0" To="System.Runtime" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="6.0.0.0" To="System.Runtime" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="7.0.0.0" To="System.Runtime" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="7.0.0.0" To="System.Runtime" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="8.0.0.0" To="System.Runtime" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="8.0.0.0" To="System.Runtime" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Runtime" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="9.0.0.0" To="System.Runtime" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
<TypeForwarding From="System.Runtime.Extensions" FromVersion="9.0.0.0" To="System.Runtime" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="4.1.0.0" To="System.Runtime.Extensions" ToVersion="4.2.0.0" FrameworkAlternate="netcore-2.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="4.1.1.0" To="System.Runtime.Extensions" ToVersion="4.2.1.0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0" />
<TypeForwarding From="System.Collections.NonGeneric" FromVersion="4.1.2.0" To="System.Runtime.Extensions" ToVersion="4.2.2.0" FrameworkAlternate="netcore-3.1" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.ICollection</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IList</InterfaceName>
</Interface>
<Interface FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1">
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Serializable]</AttributeName>
<AttributeName Language="F#">[<System.Serializable>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Diagnostics.DebuggerDisplay("Count = {Count}")]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.DebuggerDisplay("Count = {Count}")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.ArrayList+ArrayListDebugView))]</AttributeName>
<AttributeName Language="F#">[<System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.ArrayList+ArrayListDebugView))>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Implements the <see cref="T:System.Collections.IList" /> interface using an array whose size is dynamically increased as required.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!IMPORTANT]
> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic <xref:System.Collections.Generic.List`1> class.
> The <xref:System.Collections.ArrayList> class is designed to hold heterogeneous collections of objects. However, it does not always offer the best performance. Instead, we recommend the following:
> - For a heterogeneous collection of objects, use the `List<Object>` (in C#) or `List(Of Object)` (in Visual Basic) type.
> - For a homogeneous collection of objects, use the <xref:System.Collections.Generic.List`1> class.
> See [Performance Considerations](xref:System.Collections.Generic.List`1#performance-considerations) in the <xref:System.Collections.Generic.List`1> reference topic for a discussion of the relative performance of these classes. See [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub for general information on the use of generic instead of non-generic collection types.
The <xref:System.Collections.ArrayList> is not guaranteed to be sorted. You must sort the <xref:System.Collections.ArrayList> by calling its <xref:System.Collections.ArrayList.Sort*> method prior to performing operations (such as <xref:System.Collections.ArrayList.BinarySearch*>) that require the <xref:System.Collections.ArrayList> to be sorted. To maintain a collection that is automatically sorted as new elements are added, you can use the <xref:System.Collections.Generic.SortedSet`1> class.
The capacity of an <xref:System.Collections.ArrayList> is the number of elements the <xref:System.Collections.ArrayList> can hold. As elements are added to an <xref:System.Collections.ArrayList>, the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling <xref:System.Collections.ArrayList.TrimToSize*> or by setting the <xref:System.Collections.ArrayList.Capacity> property explicitly.
**.NET Framework only:** For very large <xref:System.Collections.ArrayList> objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [`<gcAllowVeryLargeObjects>`](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment.
Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.
The <xref:System.Collections.ArrayList> collection accepts `null` as a valid value. It also allows duplicate elements.
Using multidimensional arrays as elements in an <xref:System.Collections.ArrayList> collection is not supported.
## Examples
The following example shows how to create and initialize an <xref:System.Collections.ArrayList> and how to display its values.
:::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/Overview/source.vb" id="Snippet1":::
]]></format>
</remarks>
<threadsafe>Public static (<see langword="Shared" /> in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
An <see cref="T:System.Collections.ArrayList" /> can support multiple readers concurrently, as long as the collection is not modified. To guarantee the thread safety of the <see cref="T:System.Collections.ArrayList" />, all operations must be done through the wrapper returned by the <see cref="M:System.Collections.ArrayList.Synchronized(System.Collections.IList)" /> method.
Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.</threadsafe>
<altmember cref="T:System.Collections.IList" />
<altmember cref="T:System.Collections.Generic.List`1" />
<related type="Article" href="/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations-in-collections">Performing Culture-Insensitive String Operations in Collections</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.ArrayList" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ArrayList ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 ArrayList();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.ArrayList" /> class that is empty and has the default initial capacity.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of an <xref:System.Collections.ArrayList> is the number of elements that the <xref:System.Collections.ArrayList> can hold. As elements are added to an <xref:System.Collections.ArrayList>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.ArrayList>.
This constructor is an `O(1)` operation.
]]></format>
</remarks>
<altmember cref="P:System.Collections.ArrayList.Capacity" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ArrayList (System.Collections.ICollection c);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.ICollection c) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.#ctor(System.Collections.ICollection)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (c As ICollection)" />
<MemberSignature Language="F#" Value="new System.Collections.ArrayList : System.Collections.ICollection -> System.Collections.ArrayList" Usage="new System.Collections.ArrayList c" />
<MemberSignature Language="C++ CLI" Value="public:
 ArrayList(System::Collections::ICollection ^ c);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="c" Type="System.Collections.ICollection" />
</Parameters>
<Docs>
<param name="c">The <see cref="T:System.Collections.ICollection" /> whose elements are copied to the new list.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.ArrayList" /> class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of an <xref:System.Collections.ArrayList> is the number of elements that the <xref:System.Collections.ArrayList> can hold. As elements are added to an <xref:System.Collections.ArrayList>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.ArrayList>.
The elements are copied onto the <xref:System.Collections.ArrayList> in the same order they are read by the <xref:System.Collections.IEnumerator> of the <xref:System.Collections.ICollection>.
This constructor is an `O(n)` operation, where `n` is the number of elements in `c`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="c" /> is <see langword="null" />.</exception>
<exception cref="T:System.RankException">
<paramref name="c" /> is a multidimensional array.</exception>
<altmember cref="T:System.Collections.ICollection" />
<altmember cref="P:System.Collections.ArrayList.Capacity" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ArrayList (int capacity);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 capacity) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (capacity As Integer)" />
<MemberSignature Language="F#" Value="new System.Collections.ArrayList : int -> System.Collections.ArrayList" Usage="new System.Collections.ArrayList capacity" />
<MemberSignature Language="C++ CLI" Value="public:
 ArrayList(int capacity);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="capacity" Type="System.Int32" />
</Parameters>
<Docs>
<param name="capacity">The number of elements that the new list can initially store.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.ArrayList" /> class that is empty and has the specified initial capacity.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of an <xref:System.Collections.ArrayList> is the number of elements that the <xref:System.Collections.ArrayList> can hold. As elements are added to an <xref:System.Collections.ArrayList>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.ArrayList>.
This constructor is an `O(n)` operation, where `n` is `capacity`.
> [!CAUTION]
> If `capacity` comes from user input, prefer using the parameterless constructor and letting the collection resize as elements are added. If you must use a user-specified value, either clamp it to a reasonable limit (for example, `Math.Clamp(untrustedValue, 0, 20)`) or verify that the element count matches the specified value.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="capacity" /> is less than zero.</exception>
<altmember cref="P:System.Collections.ArrayList.Capacity" />
</Docs>
</Member>
<Member MemberName="Adapter">
<MemberSignature Language="C#" Value="public static System.Collections.ArrayList Adapter (System.Collections.IList list);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.ArrayList Adapter(class System.Collections.IList list) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.Adapter(System.Collections.IList)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Adapter (list As IList) As ArrayList" />
<MemberSignature Language="F#" Value="static member Adapter : System.Collections.IList -> System.Collections.ArrayList" Usage="System.Collections.ArrayList.Adapter list" />
<MemberSignature Language="C++ CLI" Value="public:
 static System::Collections::ArrayList ^ Adapter(System::Collections::IList ^ list);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.ArrayList</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="list" Type="System.Collections.IList" />
</Parameters>
<Docs>
<param name="list">The <see cref="T:System.Collections.IList" /> to wrap.</param>
<summary>Creates an <see cref="T:System.Collections.ArrayList" /> wrapper for a specific <see cref="T:System.Collections.IList" />.</summary>
<returns>The <see cref="T:System.Collections.ArrayList" /> wrapper around the <see cref="T:System.Collections.IList" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
<xref:System.Collections.ArrayList.Adapter*> does not copy the contents of <xref:System.Collections.IList>. Instead, it only creates an <xref:System.Collections.ArrayList> wrapper around <xref:System.Collections.IList>; therefore, changes to the <xref:System.Collections.IList> also affect the <xref:System.Collections.ArrayList>.
The <xref:System.Collections.ArrayList> class provides generic <xref:System.Collections.ArrayList.Reverse*>, <xref:System.Collections.ArrayList.BinarySearch*> and <xref:System.Collections.ArrayList.Sort*> methods. This wrapper can be a means to use those methods on <xref:System.Collections.IList>; however, performing these generic operations through the wrapper might be less efficient than operations applied directly on the <xref:System.Collections.IList>.
This method is an `O(1)` operation.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="list" /> is <see langword="null" />.</exception>
<altmember cref="T:System.Collections.IList" />
<altmember cref="M:System.Collections.ArrayList.BinarySearch(System.Int32,System.Int32,System.Object,System.Collections.IComparer)" />
<altmember cref="M:System.Collections.ArrayList.Reverse" />
<altmember cref="M:System.Collections.ArrayList.Sort" />
</Docs>
</Member>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public virtual int Add (object value);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Add(object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.Add(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Add (value As Object) As Integer" />
<MemberSignature Language="F#" Value="abstract member Add : obj -> int
override this.Add : obj -> int" Usage="arrayList.Add value" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual int Add(System::Object ^ value);" />
<MemberSignature Language="C#" Value="public virtual int Add (object? value);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.IList.Add(System.Object)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Object" /> to be added to the end of the <see cref="T:System.Collections.ArrayList" />. The value can be <see langword="null" />.</param>
<summary>Adds an object to the end of the <see cref="T:System.Collections.ArrayList" />.</summary>
<returns>The <see cref="T:System.Collections.ArrayList" /> index at which the <paramref name="value" /> has been added.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.ArrayList> accepts `null` as a valid value and allows duplicate elements.
If <xref:System.Collections.ArrayList.Count*> already equals <xref:System.Collections.ArrayList.Capacity*>, the capacity of the <xref:System.Collections.ArrayList> is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If <xref:System.Collections.ArrayList.Count*> is less than <xref:System.Collections.ArrayList.Capacity*>, this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is <xref:System.Collections.ArrayList.Count*>.
## Examples
The following code example shows how to add elements to the <xref:System.Collections.ArrayList>.
:::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/Add/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/Add/source.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.ArrayList" /> is read-only.
-or-
The <see cref="T:System.Collections.ArrayList" /> has a fixed size.</exception>
<altmember cref="M:System.Collections.ArrayList.AddRange(System.Collections.ICollection)" />
<altmember cref="M:System.Collections.ArrayList.Insert(System.Int32,System.Object)" />
<altmember cref="M:System.Collections.ArrayList.Remove(System.Object)" />
<altmember cref="P:System.Collections.ArrayList.Count" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public virtual void AddRange (System.Collections.ICollection c);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddRange(class System.Collections.ICollection c) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.AddRange(System.Collections.ICollection)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub AddRange (c As ICollection)" />
<MemberSignature Language="F#" Value="abstract member AddRange : System.Collections.ICollection -> unit
override this.AddRange : System.Collections.ICollection -> unit" Usage="arrayList.AddRange c" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void AddRange(System::Collections::ICollection ^ c);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="c" Type="System.Collections.ICollection" />
</Parameters>
<Docs>
<param name="c">The <see cref="T:System.Collections.ICollection" /> whose elements should be added to the end of the <see cref="T:System.Collections.ArrayList" />. The collection itself cannot be <see langword="null" />, but it can contain elements that are <see langword="null" />.</param>
<summary>Adds the elements of an <see cref="T:System.Collections.ICollection" /> to the end of the <see cref="T:System.Collections.ArrayList" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.ArrayList> accepts `null` as a valid value and allows duplicate elements.
The order of the elements in the <xref:System.Collections.ICollection> is preserved in the <xref:System.Collections.ArrayList>.
If the new <xref:System.Collections.ArrayList.Count*> (the current <xref:System.Collections.ArrayList.Count*> plus the size of the collection) will be greater than <xref:System.Collections.ArrayList.Capacity*>, the capacity of the <xref:System.Collections.ArrayList> is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added.
If the <xref:System.Collections.ArrayList> can accommodate the new elements without increasing the <xref:System.Collections.ArrayList.Capacity*>, this method is an `O(n)` operation, where `n` is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an `O(n + m)` operation, where `n` is the number of elements to be added and `m` is <xref:System.Collections.ArrayList.Count*>.
## Examples
The following code example shows how to add elements to the <xref:System.Collections.ArrayList>.
:::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/Add/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/Add/source.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="c" /> is <see langword="null" />.</exception>
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.ArrayList" /> is read-only.
-or-
The <see cref="T:System.Collections.ArrayList" /> has a fixed size.</exception>
<altmember cref="T:System.Collections.ICollection" />
<altmember cref="P:System.Collections.ArrayList.Capacity" />
<altmember cref="P:System.Collections.ArrayList.Count" />
<altmember cref="M:System.Collections.ArrayList.Add(System.Object)" />
<altmember cref="M:System.Collections.ArrayList.InsertRange(System.Int32,System.Collections.ICollection)" />
<altmember cref="M:System.Collections.ArrayList.SetRange(System.Int32,System.Collections.ICollection)" />
<altmember cref="M:System.Collections.ArrayList.GetRange(System.Int32,System.Int32)" />
<altmember cref="M:System.Collections.ArrayList.RemoveRange(System.Int32,System.Int32)" />
</Docs>
</Member>
<MemberGroup MemberName="BinarySearch">
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Uses a binary search algorithm to locate a specific element in the sorted <see cref="T:System.Collections.ArrayList" /> or a portion of it.</summary>
</Docs>
</MemberGroup>
<Member MemberName="BinarySearch">
<MemberSignature Language="C#" Value="public virtual int BinarySearch (object value);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 BinarySearch(object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.BinarySearch(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function BinarySearch (value As Object) As Integer" />
<MemberSignature Language="F#" Value="abstract member BinarySearch : obj -> int
override this.BinarySearch : obj -> int" Usage="arrayList.BinarySearch value" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual int BinarySearch(System::Object ^ value);" />
<MemberSignature Language="C#" Value="public virtual int BinarySearch (object? value);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Object" /> to locate. The value can be <see langword="null" />.</param>
<summary>Searches the entire sorted <see cref="T:System.Collections.ArrayList" /> for an element using the default comparer and returns the zero-based index of the element.</summary>
<returns>The zero-based index of <paramref name="value" /> in the sorted <see cref="T:System.Collections.ArrayList" />, if <paramref name="value" /> is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than <paramref name="value" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.ArrayList.Count" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `value` parameter and each element of the <xref:System.Collections.ArrayList> must implement the <xref:System.IComparable> interface, which is used for comparisons. The elements of the <xref:System.Collections.ArrayList> must already be sorted in increasing value according to the sort order defined by the <xref:System.IComparable> implementation; otherwise, the result might be incorrect.
Comparing `null` with any type is allowed and does not generate an exception when using <xref:System.IComparable>. When sorting, `null` is considered to be less than any other object.
If the <xref:System.Collections.ArrayList> contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
If the <xref:System.Collections.ArrayList> does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the <xref:System.Collections.ArrayList>, this index should be used as the insertion point to maintain the sort order.
This method is an `O(log n)` operation, where `n` is <xref:System.Collections.ArrayList.Count*>.
## Examples
The following code example shows how to use <xref:System.Collections.ArrayList.BinarySearch*> to locate a specific object in the <xref:System.Collections.ArrayList>.
:::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/BinarySearch/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/BinarySearch/source.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">Neither <paramref name="value" /> nor the elements of <see cref="T:System.Collections.ArrayList" /> implement the <see cref="T:System.IComparable" /> interface.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="value" /> is not of the same type as the elements of the <see cref="T:System.Collections.ArrayList" />.</exception>
<related type="Article" href="/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations-in-collections">Performing Culture-Insensitive String Operations in Collections</related>
</Docs>
</Member>
<Member MemberName="BinarySearch">
<MemberSignature Language="C#" Value="public virtual int BinarySearch (object value, System.Collections.IComparer comparer);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 BinarySearch(object value, class System.Collections.IComparer comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.BinarySearch(System.Object,System.Collections.IComparer)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function BinarySearch (value As Object, comparer As IComparer) As Integer" />
<MemberSignature Language="F#" Value="abstract member BinarySearch : obj * System.Collections.IComparer -> int
override this.BinarySearch : obj * System.Collections.IComparer -> int" Usage="arrayList.BinarySearch (value, comparer)" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual int BinarySearch(System::Object ^ value, System::Collections::IComparer ^ comparer);" />
<MemberSignature Language="C#" Value="public virtual int BinarySearch (object? value, System.Collections.IComparer? comparer);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Object" />
<Parameter Name="comparer" Type="System.Collections.IComparer" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Object" /> to locate. The value can be <see langword="null" />.</param>
<param name="comparer">The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements.
-or-
<see langword="null" /> to use the default comparer that is the <see cref="T:System.IComparable" /> implementation of each element.</param>
<summary>Searches the entire sorted <see cref="T:System.Collections.ArrayList" /> for an element using the specified comparer and returns the zero-based index of the element.</summary>
<returns>The zero-based index of <paramref name="value" /> in the sorted <see cref="T:System.Collections.ArrayList" />, if <paramref name="value" /> is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than <paramref name="value" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.ArrayList.Count" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The comparer customizes how the elements are compared. For example, you can use a <xref:System.Collections.CaseInsensitiveComparer> instance as the comparer to perform case-insensitive string searches.
If `comparer` is provided, the elements of the <xref:System.Collections.ArrayList> are compared to the specified value using the specified <xref:System.Collections.IComparer> implementation. The elements of the <xref:System.Collections.ArrayList> must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect.
If `comparer` is `null`, the comparison is done using the <xref:System.IComparable> implementation provided by the element itself or by the specified value. The elements of the <xref:System.Collections.ArrayList> must already be sorted in increasing value according to the sort order defined by the <xref:System.IComparable> implementation; otherwise, the result might be incorrect.
Comparing `null` with any type is allowed and does not generate an exception when using <xref:System.IComparable>. When sorting, `null` is considered to be less than any other object.
If the <xref:System.Collections.ArrayList> contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
If the <xref:System.Collections.ArrayList> does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the <xref:System.Collections.ArrayList>, this index should be used as the insertion point to maintain the sort order.
This method is an `O(log n)` operation, where `n` is <xref:System.Collections.ArrayList.Count*>.
## Examples
The following example creates an <xref:System.Collections.ArrayList> of colored animals. The provided <xref:System.Collections.IComparer> performs the string comparison for the binary search. The results of both an iterative search and a binary search are displayed.
:::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/BinarySearch/source2.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/BinarySearch/source2.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="comparer" /> is <see langword="null" /> and neither <paramref name="value" /> nor the elements of <see cref="T:System.Collections.ArrayList" /> implement the <see cref="T:System.IComparable" /> interface.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="comparer" /> is <see langword="null" /> and <paramref name="value" /> is not of the same type as the elements of the <see cref="T:System.Collections.ArrayList" />.</exception>
<related type="Article" href="/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations-in-collections">Performing Culture-Insensitive String Operations in Collections</related>
</Docs>
</Member>
<Member MemberName="BinarySearch">
<MemberSignature Language="C#" Value="public virtual int BinarySearch (int index, int count, object value, System.Collections.IComparer comparer);" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 BinarySearch(int32 index, int32 count, object value, class System.Collections.IComparer comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.BinarySearch(System.Int32,System.Int32,System.Object,System.Collections.IComparer)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function BinarySearch (index As Integer, count As Integer, value As Object, comparer As IComparer) As Integer" />
<MemberSignature Language="F#" Value="abstract member BinarySearch : int * int * obj * System.Collections.IComparer -> int
override this.BinarySearch : int * int * obj * System.Collections.IComparer -> int" Usage="arrayList.BinarySearch (index, count, value, comparer)" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual int BinarySearch(int index, int count, System::Object ^ value, System::Collections::IComparer ^ comparer);" />
<MemberSignature Language="C#" Value="public virtual int BinarySearch (int index, int count, object? value, System.Collections.IComparer? comparer);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
<Parameter Name="value" Type="System.Object" />
<Parameter Name="comparer" Type="System.Collections.IComparer" />
</Parameters>
<Docs>
<param name="index">The zero-based starting index of the range to search.</param>
<param name="count">The length of the range to search.</param>
<param name="value">The <see cref="T:System.Object" /> to locate. The value can be <see langword="null" />.</param>
<param name="comparer">The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements.
-or-
<see langword="null" /> to use the default comparer that is the <see cref="T:System.IComparable" /> implementation of each element.</param>
<summary>Searches a range of elements in the sorted <see cref="T:System.Collections.ArrayList" /> for an element using the specified comparer and returns the zero-based index of the element.</summary>
<returns>The zero-based index of <paramref name="value" /> in the sorted <see cref="T:System.Collections.ArrayList" />, if <paramref name="value" /> is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than <paramref name="value" /> or, if there is no larger element, the bitwise complement of <see cref="P:System.Collections.ArrayList.Count" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The comparer customizes how the elements are compared. For example, you can use a <xref:System.Collections.CaseInsensitiveComparer> instance as the comparer to perform case-insensitive string searches.
If `comparer` is provided, the elements of the <xref:System.Collections.ArrayList> are compared to the specified value using the specified <xref:System.Collections.IComparer> implementation. The elements of the <xref:System.Collections.ArrayList> must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect.
If `comparer` is `null`, the comparison is done using the <xref:System.IComparable> implementation provided by the element itself or by the specified value. The elements of the <xref:System.Collections.ArrayList> must already be sorted in increasing value according to the sort order defined by the <xref:System.IComparable> implementation; otherwise, the result might be incorrect.
Comparing `null` with any type is allowed and does not generate an exception when using <xref:System.IComparable>. When sorting, `null` is considered to be less than any other object.
If the <xref:System.Collections.ArrayList> contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one.
If the <xref:System.Collections.ArrayList> does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the <xref:System.Collections.ArrayList>, this index should be used as the insertion point to maintain the sort order.
This method is an `O(log n)` operation, where `n` is `count`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="index" /> and <paramref name="count" /> do not denote a valid range in the <see cref="T:System.Collections.ArrayList" />.
-or-
<paramref name="comparer" /> is <see langword="null" /> and neither <paramref name="value" /> nor the elements of <see cref="T:System.Collections.ArrayList" /> implement the <see cref="T:System.IComparable" /> interface.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="comparer" /> is <see langword="null" /> and <paramref name="value" /> is not of the same type as the elements of the <see cref="T:System.Collections.ArrayList" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.
-or-
<paramref name="count" /> is less than zero.</exception>
<altmember cref="T:System.Collections.IComparer" />
<altmember cref="T:System.IComparable" />
<related type="Article" href="/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations-in-collections">Performing Culture-Insensitive String Operations in Collections</related>
</Docs>
</Member>
<Member MemberName="Capacity">
<MemberSignature Language="C#" Value="public virtual int Capacity { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Capacity" />
<MemberSignature Language="DocId" Value="P:System.Collections.ArrayList.Capacity" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Capacity As Integer" />
<MemberSignature Language="F#" Value="member this.Capacity : int with get, set" Usage="System.Collections.ArrayList.Capacity" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property int Capacity { int get(); void set(int value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the number of elements that the <see cref="T:System.Collections.ArrayList" /> can contain.</summary>
<value>The number of elements that the <see cref="T:System.Collections.ArrayList" /> can contain.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.ArrayList.Capacity*> is the number of elements that the <xref:System.Collections.ArrayList> can store. <xref:System.Collections.ArrayList.Count*> is the number of elements that are actually in the <xref:System.Collections.ArrayList>.
<xref:System.Collections.ArrayList.Capacity*> is always greater than or equal to <xref:System.Collections.ArrayList.Count*>. If <xref:System.Collections.ArrayList.Count*> exceeds <xref:System.Collections.ArrayList.Capacity*> while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.
The capacity can be decreased by calling <xref:System.Collections.ArrayList.TrimToSize*> or by setting the <xref:System.Collections.ArrayList.Capacity> property explicitly. When the value of <xref:System.Collections.ArrayList.Capacity*> is set explicitly, the internal array is also reallocated to accommodate the specified capacity.
Retrieving the value of this property is an `O(1)` operation; setting the property is an `O(n)` operation, where `n` is the new capacity.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<see cref="P:System.Collections.ArrayList.Capacity" /> is set to a value that is less than <see cref="P:System.Collections.ArrayList.Count" />.</exception>
<exception cref="T:System.OutOfMemoryException">There is not enough memory available on the system.</exception>
<altmember cref="P:System.Collections.ArrayList.Count" />
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public virtual void Clear ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Clear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.ArrayList.Clear" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Clear ()" />
<MemberSignature Language="F#" Value="abstract member Clear : unit -> unit
override this.Clear : unit -> unit" Usage="arrayList.Clear " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Clear();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.IList.Clear</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.NonGeneric</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.Extensions</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>