VB.NET Pages

Dot Net Perls has example pages for many languages, with explanations and code side by side (for easy understanding).


Create string and integer arrays with initializers. Get elements, and use Length and For Each loops.VB.NET Array Examples, String Arrays


Use the List type: add, remove and get elements from Lists. Lists resize when space is needed.VB.NET List Examples


Review Class types their syntax. Use the MyClass keyword and Friend classes.VB.NET Class Examples: MyClass, Friend Classes


Concat strings with the plus-operator or the String.Concat Function.VB.NET String.Concat Examples


Use the Console: call the Console.Write, WriteLine and ReadLine subs.VB.NET Console.Write, WriteLine, ReadLine Examples


Use DataTable to store data in memory from databases and other data sources.VB.NET DataTable Examples

DateTime format.

Use DateTime format patterns. Call the ToString method with a format string.VB.NET DateTime Format


Use DateTime in programs. Access DateTime constructors and properties.VB.NET DateTime Examples


Use Dictionary and add keys and values. Call ContainsKey and TryGetValue to look up elements.VB.NET Dictionary Examples


Use Enum values to stores named and magic constants. Use if-statements with enums.VB.NET Enum Examples


Handle files: in the System.IO namespace, use StreamReader and StreamWriter.VB.NET File Handling

For, For Each.

Use For to increment or decrement with a Step. With For Each, enumerate an array.VB.NET For Loop Examples (For Each)

If Then.

Use the If Then statement. See examples for the If, ElseIf, Else and End keywords.VB.NET If Then, ElseIf, Else Examples


Call the IndexOf Function. IndexOf returns the index of a substring as an Integer.VB.NET IndexOf Function


Use the Integer.Parse and TryParse Functions to convert Strings to Integers.VB.NET Integer.Parse: Convert String to Integer


See the keywords in VB.NET. Keywords are used in declarations and statements.VB.NET Keywords


Create lambda expressions and pass them to other methods. Use the Function keyword.VB.NET Lambda Expressions


Use LINQ, a set of extensions to the language that enable queries.VB.NET LINQ Examples: Queries, Extensions


Use Nothing and IsNothing. A reference that points to nothing can cause an Exception.VB.NET Nothing, IsNothing (Null)


Use the Process.Start Function. Open Microsoft Word, web browsers and text files.VB.NET Process Examples (Process.Start)


Use the Property keyword to improve program syntax. A property gets and sets values.VB.NET Property Examples (Get, Set)


Use the Random class. Random has a Next Function and is often used as a field.VB.NET Random Numbers


Use Regex from System.Text.RegularExpressions. Match Strings based on patterns.VB.NET Regex.Match Examples: Regular Expressions


Call the Replace Function. Change all instances of one substring to another and get a new String.VB.NET Replace String Examples

Select Case.

Use the Select Case statement with integers, Chars and Strings. See a nested Select Case.VB.NET Select Case Examples


See examples for sorting. Use the Array.Sort and List.Sort Functions to sort arrays and Lists.VB.NET Sort Examples: Arrays and Lists


Separate strings on a value with the String.Split function. Use Char and String delimiters.VB.NET Split String Examples


Use the String type: create, search and modify strings. Test string functions.VB.NET String


Call the String.Format Function with patterns. Insert numbers and values into strings.VB.NET String.Format Examples: String and Integer


Use the StringBuilder class to improve performance with String appends.VB.NET StringBuilder Examples

Subs, functions.

Use the Sub keyword for a subroutine. See the syntax for parameters and comments.VB.NET Sub Procedure Examples


Use the Substring Function to get parts of strings. Review the arguments to Substring.VB.NET Substring Examples

ToLower, ToUpper.

Use the ToLower and ToUpper Functions on strings to change the cases of letters.VB.NET ToLower and ToUpper: String Uppercase, Lowercase


Use TryCast and DirectCast. Handle invalid casts and view casting syntax.VB.NET Cast: TryCast, DirectCast Examples

While, Do While.

Use the Do While and While loops. Keep looping as long as a condition remains True.VB.NET Do While Loop Examples (While)
Dot Net Perls
© 2007-2019 Sam Allen. All rights reserved. Written by Sam Allen,