From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Solution: Logic statements and string compare

Solution: Logic statements and string compare - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Solution: Logic statements and string compare

(upbeat music) - [Instructor] I hope you found that an interesting challenge. Here's how I solved the problem. Remember, your solution may be different from mine. I'm going to start by looking for the word pet. Click on the show results button and the result shows pet is in the first string, in the second string, and in both strings. Next, I'm going to search for this word help. That's not found in the first string, but it is found in the second string. And then the last one, I'm going to look for the word fish without the space. Show results. Found it in the first string, second string, and both strings. Now, here's one issue that you have to think about. The word fish is here, but it's also here in the word goldfish. As a programmer, you have to decide whether you want to match the entire word, goldfish, or if you're looking for a sub part of that word. In my case, I decided I was just looking for the letters F-I-S-H, so it found it at the end of the word goldfish. Let's go take a…

Contents