Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > Most represente...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 766 of 792
Post > Topic >>

Most represented string in a TStringlist

by Fister <nej@[EMAIL PROTECTED] > Nov 21, 2007 at 09:04 PM

Hi

Is there an elegant way to determine which string is mostly represented in

a TStringList? For instance if I've got the following the function should 
return 'Delphi':

StringList[0] := 'Pascal';
StringList[1] := 'Pascal';
StringList[2] := 'Delphi';
StringList[3] := 'Delphi';
StringList[4] := 'Delphi';

I've made my own solution where I sort the TStringList and loop the list 
until the string changes and then I determine the count and compare it to 
a max value which is set if the count value if larger than max value.




 3 Posts in Topic:
Most represented string in a TStringlist
Fister <nej@[EMAIL PRO  2007-11-21 21:04:24 
Re: Most represented string in a TStringlist
Marco van de Voort <ma  2007-11-22 10:09:57 
Re: Most represented string in a TStringlist
"Jochen" <jo  2007-11-22 17:11:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 0:31:46 CDT 2008.