VB.NET : Keyword

["?0?1w0*0|string-concat-vbnet;datetime-format-vbnet;do-while-vbnet;keyword-vbnet;-vbnet|concat;dates",["F@dA","JAICLAKAJAQA","OOCCESTUUUUTTUUUUYGDGDHDGDGDGDFOCPHDGDHDGDFOCCEOBWSTTUUUUTTUUUU","shdwrsdd.","Keyword","Array","Dictionary","List","String","ArrayList","Cast","Class","Concat","Console","DataTable","Dates","DateTime","Enum","File","For","Format","If","IndexOf","Lambda","LINQ","Nothing","Parse","Process","Property","Random","Regex","Replace","Select","Sort","Split","StringBuilder","Sub","Substring","While","KeyValuePair."," A KeyValuePair is a Structure. It has two fields of specified types. It stores two pieces of data together as a single object. In VB.NET it is useful. It defines a Structure of any kind of key, and any kind of value.","Example."," In this first example, we create a List that stores element of type KeyValuePair. Notice how the (Of String, Integer) syntax is used to specify that the key of the pair is a String, and the value is an Integer. ","Note: ","When creating a KeyValuePair, you must set the key and the value in the constructor.","And: ","Finally in this example, we loop through all the elements of the list with For-Each.","For Each ","for-each-vbnet","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","br","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","VB.NET program that creates List of KeyValuePair instances","\n\nModule Module1\n Sub Main()","\n ' Create List of key-value pairs.\n ","Dim list As List(Of KeyValuePair(Of String, Integer)) =\n New List(Of KeyValuePair(Of String, Integer))\n list.Add(New KeyValuePair(Of String, Integer)(\"dot\", 1))\n list.Add(New KeyValuePair(Of String, Integer)(\"net\", 2))\n list.Add(New KeyValuePair(Of String, Integer)(\"perls\", 3))","\n\n ' Loop over pairs.\n ","For Each pair As ","KeyValuePair","(Of String, Integer) In list","\n ' Get key.\n ","Dim key As String = pair.Key","\n ' Get value.\n ","Dim value As Integer = pair.Value","\n ' Display.\n ","Console.WriteLine(\"{0}, {1}\", key, value)\n Next\n End Sub\nEnd Module\n\n","Output","\n\ndot, 1\nnet, 2\nperls, 3","Example 2."," Sometimes you may want to return two values at once from a function in your VB.NET program. You could use the ByRef modifier. But the KeyValuePair can also be returned. The Key and Value can store the two values. ","Here: ","In this example, the GetPair Function returns a new instance of the KeyValuePair type that has a specific key and value.","VB.NET program that returns KeyValuePair from Function","\n\nModule Module1\n Sub Main()\n Dim pair As ","KeyValuePair","(Of Integer, Integer) = GetPair()\n Console.WriteLine(pair.Key)\n Console.WriteLine(pair.Value)\n End Sub\n\n Function GetPair() As KeyValuePair(Of Integer, Integer)","\n ' Create new pair.\n ","Dim pair As ","KeyValuePair","(Of Integer, Integer) =\n New KeyValuePair(Of Integer, Integer)(5, 8)","\n ' Return the pair.\n ","Return pair\n End Function\nEnd Module\n\n","Output","\n\n5\n8","Tuple."," The KeyValuePair is restricted to a key and a value, but the Tuple type can have more items in its memory. If you need three of more fields grouped together, please check out the Tuple type. ","Note: ","One drawback of the Tuple type is that is must be allocated on the managed heap as an object instance.","However: ","The KeyValuePair is a structure so it can often be allocated in the stack memory.","Tuple ","tuple-vbnet","Dictionary."," The easiest way to loop over the keys and values in a Dictionary instance is with the For-Each loop construct. In this code, you must use the KeyValuePair type as the type of the enumeration variable in the loop. ","Dictionary ","dictionary-vbnet","Summary."," KeyValuePair stores a key and a value together in a single object in memory. It is a value type. This makes it more efficient in some cases and less efficient in others. A common usage is in the For-Each loop in a Dictionary. ","br","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","3679700504","data-ad-format","link","br","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto"],"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAABaBAMAAAD0j/E6AAAAGFBMVEX////yQmNChfJfX1+QkJC4uLjV1dXq6uomAbS5AAABZ0lEQVR4Xu3aMWvDMBAF4GuJpbX9C/0FgXfZDYoze5DTVUNMVi3N72+tUI9FB30Qt3qz+TDo/DiB5dUSWfL8Zsj2/RepzdO3L9X5Zb/5zW/+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