Link to home
Start Free TrialLog in
Avatar of whitetea
whitetea

asked on

arry string compare

There are 5 string fields. The string sets will be an arry i=0 to j.
My question is how can I get the most common string set?
Do I need to use two arrys to compare the 5 strings 0-j times?
Thank you for your help. I'm new here and don't have any idea.
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Can you show some code/example? What versions of VB are you using ?
Avatar of whitetea
whitetea

ASKER

Dim i as interger
Dim j as interger

string1 as string
string2 as string
string3 as string

            For i = 1 To j - 1
                With Results(i)
                    If String.IsNullOrEmpty(.String1.ToString) = False And _
                    String.IsNullOrEmpty(.String2.ToString) = False And _
                    String.IsNullOrEmpty(.String3.ToString) = False Then
                        Response.Write(.String1)
                        Response.Write(.String2)
                        Response.Write(.String3)
                    ElseIf String.IsNullOrEmpty(.String1.ToString) = False And _
                        String.IsNullOrEmpty(.String2.ToString) = False Then
                        Response.Write(.String1)
                        Response.Write(.String2)
                    ElseIf String.IsNullOrEmpty(.String1) = False And _
                        String.IsNullOrEmpty(.String3) = False Then
                        Response.Write(.String1)
                        Response.Write(.String3)
                    ElseIf String.IsNullOrEmpty(.String2) = False And _
                        String.IsNullOrEmpty(.String3) = False Then
                        Response.Write(.String2)
                        Response.Write(.String3)
                    Else
                    End If
                End With

            Next i
 
I get more than one result returned. This is wrong. I only want one string set return with most field fill in (some of them are empty)

I'm using Visual studio 2005.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of whitetea
whitetea

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.