Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi....

 

I sure have a lot of questions today!!!

 

I have a string (S1) of CSV type. And I have another string (S2) of the same type, i.e. it is also a string with csv values.

 

Now, how can I check if any of the values in string S1 match with any of the values in string S2 ?????

 

~ SJ

  • *Experts*
Posted

Is this pure .NET code, or something in a stored procedure?

 

Either way, you're going to break apart each string into the individual values. In C# you could use the Split method of the string object. You could then loop through the array (or maybe use the Contains method?) for each value in the Other array and see there are any matches. In SQL you don't have arrays so you'd have to put each individual value into a temp table and do the comparison thataways :)

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...