Solved

Find a string that contains part of another string

Posted on 2008-10-14
2
745 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
ID: 22714427
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
ID: 31506015
Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SqlServer no dupes 25 38
VB.Net - Not Sure if Multi-threading is What I Need 4 30
Complex SQL statement in VB.NET 7 31
Passing data between Forms 3 20
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

829 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