Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compare Two Strings
Message
De
20/05/2005 14:18:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
01016294
Message ID:
01016303
Vues:
9
This message has been marked as a message which has helped to the initial question of the thread.
>All:
>
>I need to parse two strings and return the differences in HTML formatted code string.
>
>For example:
>“This is test of the HTML text comparison parser”
>“This is a test of the new parse HTML page text comparison parser, developed by us”
>
>Resulting string:
>“This is a test of the new parse HTML page text comparison parser, developed by us
>
>Can this be done in VFP? Seems to me I would have to do something like this using regular expressions; if so are there any utilites that can I can use to in VFP to call regular expressions?
>
>Any ideas?
>
>Thanks!
>
>--Paul

like a start point:
CLEAR
x="This is test of the HTML text comparison parser"
y="This is a test of the new parse HTML page text comparison parser, developed by us"

FOR k=1 TO ALINES(aWords,CHRTRAN(m.y,[,],[ ]),[ ])
   IF [ ]+aWords[m.k]+[ ] $ [ ]+m.x+[ ]
      LOOP
   ENDIF
   m.y = ALLTRIM(STRTRAN([ ]+m.y+[ ],[ ]+aWords[m.k]+[ ],[ <b>]+aWords[m.k]+[</b> ]))
NEXT
? m.y
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform