From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Interesting list properties

Interesting list properties - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Interesting list properties

- [Instructor] And at this point, we've looked at the basics of the generic list class. In this video, we'll look at some of its interesting methods that can simplify everyday tasks. We'll start by looking in the number generator module. I've been using this throughout the course, and I have these methods like get random odd number and get random even number, and all of them return a single integer. That means that if you want 15 random odd numbers, you have to write a four loop and call my method 15 times. I can make your life better or more interesting or easier by creating a method in my module that returns a list of integers or a list of string or a list of doubles, and that's what I've done at the bottom of this module right here in line 44. A declare to function called get odd numbers list that returns a list of integer. You tell me how many numbers you want with a list count, I'll generate a list of integers…

Contents