Login Register






Tutorial Splits & Arrays & For Each Loops MSVS 2012 filter_list
Author
Message
RE: Splits & Arrays & For Each Loops MSVS 2012 #2
If you're going to post a tutorial, what you say should be proper as well as the code that goes with it.

Quote:I hope to provide you all with a greater understanding of splits and arrays.

"splits and arrays"? *Almost implying that they are similar things here.

Split() is a method, an Array is a range of elements that can be accessed by index.

Quote:An array is a systematic arrangement of objects, usually in rows and columns.

That would be a better reflection of a multi-dimensional (2D) array. Rows and Columns cannot be expressed within a single dimensional array really. There's also jagged arrays, which is more like groups of groups.

Your "uses" are comfusing as well:
Quote:Better Organizing Data
Passing Variable Data In Line
Easier To Process Web Strings
More Efficient Than Complex Algorithms

Arrays are more efficient than complex algorithms??

Arrays can use complex algorithms...

You also shouldn't be promoting this:
Code:
Dim OurArray As Array

1. Bad naming convention here
2. You shouldn't be declaring it as just an Array
3. This will fail with option strict on, because implicit type casting is happening with that string being converted to a char.
Code:
OurArray = txtInput.Text.Split("|")
4. There's nothing explicit about this:
Code:
For Each ArrayItem In OurArray Next
5. Debatable, but in VB.NET for string concatenation you should be using & over +:
Code:
MessageBox.Show("The current string in the array is: " + ArrayItem, "Our Array's Contents", MessageBoxButtons.OK, MessageBoxIcon.Information)
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply





Messages In This Thread
RE: Splits & Arrays & For Each Loops MSVS 2012 - by cxS - 02-27-2013, 06:26 PM