﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>A1VBCode Forums / .NET Programming (VB 2010 or earlier) / ASP.NET  / Searching A String, For A Match From Another String / Latest Posts</title><generator>InstantForum.NET v4.1.1</generator><description>A1VBCode Forums</description><link>http://www.a1vbcode.com/vbforums/</link><webMaster>forums@a1vbcode.com</webMaster><lastBuildDate>Thu, 09 Feb 2012 00:02:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Searching A String, For A Match From Another String</title><link>http://www.a1vbcode.com/vbforums/Topic28019-10-1.aspx</link><description>Refer this link&lt;br&gt;&lt;br&gt;&lt;a href="http://www.vb6.us/tutorials/vb6-string-functions" target="_blank" class="SmlLinks"&gt;http://www.vb6.us/tutorials/vb6-string-functions&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithStringsP311232005021723AM/WorkingWithStringsP3.aspx" target="_blank" class="SmlLinks"&gt;http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithStringsP311232005021723AM/WorkingWithStringsP3.aspx&lt;/a&gt;</description><pubDate>Mon, 01 Feb 2010 06:31:12 GMT</pubDate><dc:creator>paul daniel</dc:creator></item><item><title>RE: Searching A String, For A Match From Another String</title><link>http://www.a1vbcode.com/vbforums/Topic28019-10-1.aspx</link><description>Check out regular expressions.</description><pubDate>Wed, 27 Jan 2010 08:52:29 GMT</pubDate><dc:creator>Mobius</dc:creator></item><item><title>Searching A String, For A Match From Another String</title><link>http://www.a1vbcode.com/vbforums/Topic28019-10-1.aspx</link><description>So what I have is two strings..  Each string is a comma seperated value of two digit states.  Like this&lt;br&gt;&lt;br&gt;String 1:&lt;br&gt;"NV,CA,AZ"&lt;br&gt;&lt;br&gt;String 2:&lt;br&gt;"ND,HI,CA"&lt;br&gt;&lt;br&gt;What I need to do, is write some C# to check string 2, for a match in string 1.  Meaning, If a state is listed in String 1, it should not appear in String 2.  I have used "foreach" statements, but only for list boxes.  I can seperate the strings, but am having an issue writing the code to compare the two.  Here's what I got so far, it will check the first thing in each list, but will not go onto the second or third?  How can I change the int inside String1[0] to +1 for every item in it's list? &lt;br&gt;&lt;br&gt;Edit:&lt;br&gt;It would be awesome if the code could find the position of the match in the second string, and remove it.  So if it finds CA from String1, in String2, it would remove it from String2.&lt;br&gt;   1. string[] String1 = LabelAllStates.Text.Split(new char[] { ',' });  &lt;br&gt;   2. string[] String2 = LabelAllCountyStates.Text.Split(new char[] { ',' });  &lt;br&gt;   3.   &lt;br&gt;   4. foreach (String myCountyList in String1)  &lt;br&gt;   5. {  &lt;br&gt;   6.     if (String1[0] == String2[0])  &lt;br&gt;   7.     {  &lt;br&gt;   8.         // Detected a match, therefore I fail validation  &lt;br&gt;   9.     }  &lt;br&gt;  10.     else  &lt;br&gt;  11.     {  &lt;br&gt;  12.         // No match found!  Good job!  &lt;br&gt;  13.     }  &lt;br&gt;  14. }  &lt;br&gt;</description><pubDate>Tue, 11 Aug 2009 07:46:09 GMT</pubDate><dc:creator>mangopalaya</dc:creator></item></channel></rss>
