Solved

Find a string that contains part of another string

Posted on 2008-10-14
2
747 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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