Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips

Arrays - Page 3

41-60 of 103     Previous     Next
ArrayIndexOf - An extended version of Array.IndexOf
by Marco Bellinaso
An extended version of Array.IndexOf, with more options for string searches. The function returns the index of the found element, or -1 if no element is found Example: Dim arr As String() = {"this is a string for my test", "test number 2", "another String", "do you like this string?", "I like ...
ArrayLastIndexOf - An extended version of Array.LastIndexOf
by Marco Bellinaso
An extended version of Array.LastIndexOf, with more options for string searches. The function returns the index of the found element, or -1 if no element is found Example: Dim arr As String() = {"this is a string for my test", "test number 2", "another String", "do you like this string?", "I ...
ArrayListMerge - Merging two ArrayList avoiding duplicate values
by Marco Bellinaso
Merge two ArrayList, avoiding duplicate values (if there are already duplicate values in same input ArrayList however, they are not discarded) Example: Dim al1 As New ArrayList al1.Add("John") al1.Add("Ann") al1.Add("Frank") Dim al2 As New ArrayList al2.Add("Ann") al2.Add("Tony") al2.
Create a Statically Initialized List of Objects
by Robert Patterson
Copy One Array to Another Without Using Loops or Conditions
by Elayaraja David
ArrayAvg - The average of an array of any numeric type
by Marco Bellinaso
The average of an array of any numeric type Example: Dim arr As Integer() = {3, 7, 8, 2, 0, 9} MessageBox.Show(ArrayAvg(arr))
ArrayFilter - Filtering arrays of any type, with many options
by Marco Bellinaso
Filter the input array. It can work with string arrays or arrays of other type! The input array is modified by removing the elements that do not match the filter options, but the array is not actually re-sized. The filter results will be moved at the beginning of the array, and empty elements ...
ArrayReplace - A Replace routine that works through all the items of the input array
by Marco Bellinaso
A Replace routine that works through all the items of the input array Example: Dim arr As Integer() = {3, 7, 8, 2, 7, 0, 9, 7} ArrayReplace(arr, 7, 100) Dim o As Object For Each o In arr Debug.Write(o & " ") Next Debug.WriteLine("")
ArraySum - The sum of an array of any numeric type
by Marco Bellinaso
The sum of an array of any numeric type Example: Dim arr As Integer() = {3, 7, 8, 2, 0, 9} MessageBox.Show(ArraySum(arr))
FillRandomArray - Fill the input array with random values
by Marco Bellinaso
Fill the input array with random values Example: Dim arr(9) As Integer FillRandomArray(arr, 1, 11) Dim i As Integer For i = 0 To 9 Debug.Write(arr(i) & " ") Next Debug.WriteLine("")
SwapArrayItems - Swap two elements in the input array
by Marco Bellinaso
Swap two elements in the input array Example: Dim arr As Integer() = {3, 7, 8, 2, 0, 9} SwapArrayItems(arr, 1, 4) Dim o As Object For Each o In arr Debug.Write(o & " ") Next Debug.WriteLine("")
TransposeMatrix - Evaluate the transposed matrix
by Marco Bellinaso
Evaluate the transposed matrix A transposed matrix is the array you get when you "rotate" a bi-dimensional array Example Dim arr(,) As Double = {{0.0, 0.1, 0.2}, {1.0, 1.1, 1.2}} Dim i, j As Integer print the original matrix Debug.WriteLine("Original matrix") For i = 0 To arr.
GetRandomArrayItem - Return a random item from an array or collection
by Marco Bellinaso
Return a random item from a mono/bi/tri-dimensional array or collection Example: Dim arr1 As String() = {"this is string 0", "this is string 1", _ "this is string 2", "this is string 3", "this is string 4"} Dim i As Integer For i = 1 To 10 Debug.WriteLine(GetRandomArrayItem(arr1)) Next
Use a Regular Expression to Initialize a String Array (C#)
by A. Russell Jones, Executive Editor
Want to declare and initialize a string array, but tired of typing all those quotes and commas? You can do it with one line of code.
Use a Regular Expression to Initialize a String Array (VB.NET)
by Russell Jones
Want to declare and initialize a string array, but tired of typing all those quotes and commas? You can do it with one line of code.
SemiCRC - A fast CRC-like algorithm
by Ernest Bayazitov
Evaluate the 16-bit Checksum of an array of bytes
RLEUncompress - Uncompress data compressed using RLECompress
by Francesco Balena
Uncompress a block of data compressed with RLECompress Returns TRUE if successful (this version either returns True or raises an error) ADDRESS points to the buffer that holds the compressed data use StrPtr(s) if it's a string, VarPtr(arr(0)) if it's an array BYTES is the size of the ...
ArrayDeleteElement - Deleting an element in any type of array
by Francesco Balena
A generic routine that deletes an element in any type of array. Example: deleting the 2nd element of the array arr ArrayDeleteElement(arr, 1)
ArrayInsertElement - Inserting an element in any type of array
by Francesco Balena
A generic routine that inserts an element in any type of array. Example: inserting an entry of value 5 between the 1st and 2nd entry of the array arr ArrayInsertElement(arr, 1, 5)
ArrayListJoin - Merging two ArrayList objects
by Francesco Balena
A reusable function that merges two ArrayList objects Example: Dim al As New ArrayList() al.Add("Jack") al.Add("Mary") val.Add("Bob") al.Add("Tom") Dim al2 As New ArrayList() al2.Add("Frank") al2.Add("Lee") al2.Add("Nick") al = ArrayListJoin(al, al2)
41-60 of 103     Previous     Next
Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date