/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/visualbasic/VS_Snippets_CLR/HowToGeneric/VB/source2.vb
28 строк
902 B
Next Turn
Format codes based on .editorconfig, Part 7 (#18887)
11 июн 2020, 15:38
Не верифицирован
11 июн 2020, 15:38
783654b
Код
Авторство
О чём код?
'<snippet23> Imports System.Collections.Generic Class AdvantageGenerics Public Shared Sub Main() Dim myArray() As String = _ {"First String", "test string", "Last String"} '<snippet24> Dim llist As New LinkedList(Of String)() '</snippet24> For Each item As String In myArray llist.AddLast(item) Next item Dim found As LinkedListNode(Of String) = llist.Find("test string") If Not (found Is Nothing) Then Console.WriteLine("Item found: {0}", found.Value) End If '<snippet25> Dim index0 As Integer = Array.BinarySearch(myArray, "test string") Dim index1 As Integer = Array.BinarySearch(Of String)(myArray, "test string") '</snippet25> Console.WriteLine("Indexes for binary searches: {0}, {1}", index0, index1) End Sub End Class '</snippet23>