Strings Comparisons

Results 1 to 4 of 4

Thread: Strings Comparisons

  1. #1
    Ali Guest

    Default Strings Comparisons

    If you have two strings, a search string taken from the user as input. This string may consist of, let&#039;s say 100 words. The other string is a memo field in a database that may consist of 2500 words. What I have been trying to do is displaying the database field where any of the words in the first string that occurs in the second (field) is bolded. I have tried to split the two strings into arrays and then comparing the two strings. But this solution is way too slow. <BR>Please if you know a better solution, I would very much appreciate it if you provide the code for me.

  2. #2
    Join Date
    Dec 1969

    Default RE: Strings Comparisons

    Don&#039;t really know if this will work, it was my first thought. I didn&#039;t really test this.<BR><BR>Replace([memofield],[searchstring],"&#060;b&#062;" & [searchstring] & "&#060;/b&#062;")<BR><BR>Please let me know if this works, or if you&#039;ve found another way. I might need the same option in the near future.<BR><BR>Peter

  3. #3
    Ali Guest

    Default RE: Strings Comparisons

    Unfortunately, it didn&#039;t work. It shows the error message below. Besides I need it to bold any word in the search string and not the whole search string. I have done this if the whole search string is bolded. I can provide it to you if you like.<BR><BR>Error Type:<BR>Microsoft VBScript compilation (0x800A0414)<BR>Cannot use parentheses when calling a Sub<BR>/MyWork/header2.asp, line 52, column 42<BR>Replace(str ,word , "&#060;b&#062;" & word & "&#060;/b&#062;")<BR>-----------------------------------------^

  4. #4
    Ali Guest

    Default Strings Comparisons Solved.

    Phew!!! I finally found the solution for my question. For those of you who have had trouble doing so just click on this link. There you will find three solutions to this problem.<BR><BR><BR><BR>Happy Programming!!

Posting Permissions

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