Working with Arrays

  • { "Monday", "Tuesday", "Wednesday" } [initializes an array]
  • myStringArray(1) = "Friday" [sets the second element in the array]
  • myString = myStringArray(0) [gets the first element in the array]
  • Sort(myArray) [sorts an array in ascending order]
  • Sum() [calculates the sum of all array elements]
  • Min() [retrieves the lowest value in the array]
  • Length [retrieves the number of elements in the array]
  • Average() [calculates the average of all array elements]
  • mySplittedArray = myString.Split(CChar(",")) [splits a string on a single character (here: every time when a comma is found); returns an array of strings (if the seperator is not found, the original string will be returned)]
  • mySplittedArray = myString.Split(New String() { "Thursday" }, StringSplitOptions.None) [splits a string every time when a "Thursday" appears in the string; returns an array of strings (if the seperator is not found, the original string will be returned)]
Was this article helpful?
0 out of 0 found this helpful