Solved

Find a string that contains part of another string

Posted on 2008-10-14
2
749 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 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