Wrox Programmer Forums
|
.NET 4 and Visual Studio 2010 General Discussions For discussing anything about .NET 4, WPF, WCF, the rest of the .NET 4 Framework, and Visual Studio 2010 that isn't about a specific Wrox book. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET 4 and Visual Studio 2010 General Discussions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2016, 11:05 AM
Friend of Wrox
 
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default I have a string array that I need help with

My shared sub, the strCitationNumbers string array can have a number or 'No match' text.
So I would like to add if statement to check what's in the strCitationNumbers.
If a number (string) is found in the strCitationNumbers, I want to output an error message saying 'Duplicate case'.
How do I do it?
Code:
Shared Sub TestCitationGetCaseNumber()
         Dim strCitationNumbers() As String
        Dim strCitationNumber As String = "2770043451123"
 strCitationNumbers = Msc.Integration.Mncis.Library.v4.Citation.GetCaseNumbersForCitation(strCitationNumber, False)   End Sub

Last edited by winkimjr2; August 12th, 2016 at 11:21 AM.. Reason: Explained what the If statement is needed for
 
Old August 12th, 2016, 12:28 PM
Friend of Wrox
 
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default Solution

Here is my solution

Code:
 If (strCitationNumbers(0) <> "No Matching Case") Then
            MsgBox("This is a duplicate")
        End If





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with String.Array fullingdale ASP.NET 2.0 Basics 0 February 14th, 2011 04:46 AM
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
String to array ajit Javascript 5 January 20th, 2007 04:02 PM
Casting String array to string Samatha ASP.NET 1.0 and 1.1 Professional 1 December 5th, 2006 07:46 AM
String to Array Psion PHP How-To 1 September 5th, 2006 11:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.