Getting rid of repetitions

Results 1 to 2 of 2

Thread: Getting rid of repetitions

  1. #1
    Join Date
    Dec 1969

    Default Getting rid of repetitions

    I have two fields in a DB: strConformsTo and strHyperlink.<BR><BR>These are some sample values for the fields: <BR>strConformsTo = "Other Main Documents - Development on Contaminated Land"<BR>strHyperLink = ""<BR><BR>Another:<BR>strConformsTo = "Other Main Documents - Environmental Protection Act 1990"<BR>strHyperLink = ""<BR><BR>What would like to do is to drop the repetitions of the string "Other Main Documents - " and only have it at the start and have the others listed separated by a comma.<BR><BR>So the final result of the above values would be:<BR><BR>&#060;a href=""&#062;Other Main Documents - Development on Contaminated Land&#060;/a&#062;, &#060;a href=""&#062;Environmental Protection Act 1990&#060;/a&#062;<BR><BR>There could be one strConformsTo or many.<BR><BR>Does anyone have any ideas for this one?<BR><BR>Thanks,<BR>Jamie

  2. #2
    Join Date
    Dec 1969

    Default Well, I assume...

    ..the way you split the string is by the "-", yeah?<BR><BR>So you need to have a string which you compare to that.<BR><BR>&#060;%<BR>Dim strStartString: strStartString = ""<BR>Dim strTemp: strTemp = ""<BR>For i=0 to UBound(arrResults, 2)<BR> strTemp = Split(strConformsTo, "-")<BR> if strTemp &#060;&#062; strStartString then<BR> &#039; Code to write header<BR> end if<BR> &#039; Rest of code<BR>Next<BR>%&#062;<BR><BR>Get it?<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts