Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?
*/

Other Views

corner
*/

VB.NET School - Arrays, Collections, and String Manipulation - Lesson #8 - Page 1

Next Page



Arrays, collections and string Manipulation

If you are new to the VB.Net School
This is the 8th in the series of lessons in the VB.Net School. The VB.Net School is a kind of interactive learning platform where those who want to learn .NET with VB.Net can find help and support. With one issue a week, describing some areas of the VB.Net Programming Language with the Microsoft .Net Platform, this is not the same traditional passive tutorial where the author only writes and the reader only reads. There will be exercise problems at the end of each issue, which the reader is expected to solve after reading the issue. The solution to these problems will be provided in the next issue for testing purposes. There is also a dedicated message board attached with the school, where you can ask questions about the article, and the author will respond to your question within 2/3 days. You can send your suggestions, feedback or ideas on how these lessons can be improved to either the Author ( farazrasheed@acm.org) or the WEBMASTER ( info@programmersheaven.com). For previous lessons click here

Lesson Plan
In this lesson we will explore arrays, collections and string manipulation in VB.Net. First of all, we will explore multidimensional (rectangular and jagged) arrays. We will also explore how For Each iterates through a collection. Then we will move on to collections and see how they are implemented. Later, we will explore different collections like ArrayList, Stack, Queue and Dictionaries. Finally, we will see how strings are manipulated in VB.Net. We will explore both the String and StringBuilder types.

Arrays Revisited
As we have seen earlier, an array is a sequential collection of elements of a similar data type. In VB.Net, an array is an object and thus a reference type, and therefore they are stored on the heap. We have only covered the single dimensional arrays in the previous lessons, now we will explore multidimensional arrays.

Multidimensional Arrays
A multidimensional array is an 'array of arrays'. A multidimensional array is the one in which each element of the array is an array itself. It is similar to tables of a database where each primary element (row) is the collection of other secondary elements (columns). If the secondary elements do not contain a collection of other elements, it is called a 2-dimensional array (the most common type of multidimensional array), otherwise it is called an n-dimensional array where n is the depth of the chain of arrays. There are two types of multidimensional arrays in VB.Net 1.A Rectangular array (the one in which each row contains an equal number of columns)
2.A Jagged array (the one in which each row does not necessarily contain an equal number of columns)


The images below show how the different kinds of array looks. This figure also shows the indexes of the different elements in the arrays. Remember, the first element of an array is always zero (0).
http://www.programmersheaven.com/articles/faraz/lesson8_img1ver2.gif



School Home
Next Page





corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings