If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > string count

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-06, 14:09
rrnml rrnml is offline
Registered User
 
Join Date: Sep 2004
Posts: 5
string count

I have a string that contains a group of numbers and I want a count of what is in the string except for duplicates. For example, I get this output in my string....(,594070,101348,100712,100290,100290,101 012)

So the count as I would like would be 5. In any instance of a duplicate I would like for it to count only as one. So how would I go about counting what's in this string to get the desired result? Thanks!
Reply With Quote
  #2 (permalink)  
Old 10-19-06, 05:35
wash wash is offline
Registered User
 
Join Date: Aug 2004
Location: Pune,India
Posts: 94
if you trying to do this in ASP, it will need far more code.

I'll try to post a kinda pseudo for you.

1. use Split() function in vbscriptto create a string array from this comma
separated string.
2. write a loop to eliminate the repititive items.
3. Write a loop to count the matches.

Hope this helps.
__________________
In GOD we believe. Everything else we Test!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On