Solved

Find a string that contains part of another string

Posted on 2008-10-14
2
742 Views
Last Modified: 2013-05-09
If I have a string that contains "ABC" and I want to compare it against an array and find the item that contains "ABC", how would I do that?  The array item could have other different characters in it, so it could look like "123ABC456".   I need to search the array using wildcards (*ABC*).
0
Comment
Question by:stewdaddy
2 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 250 total points
Comment Utility
You can loop through each string in an array
Use Contains() method of string, this will return true if first string contains second string in it

dim bContains as boolean
Dim str As String = "hello"
bContains = str.Contains("hell")
0
 

Author Closing Comment

by:stewdaddy
Comment Utility
Thanks.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now