Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identifying differences between two character strings
Message
De
07/07/2003 13:13:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00806505
Message ID:
00807531
Vues:
16
Depending on the exact requirements this may work
funtion StrDiff(tc1,tc2)
local lcdiff,lc1,lc2
lcdiff = ''
if vartype(tc1) = 'C' and vartype(tc2) = 'C'
  if len(tc1) > len(tc2)
    lc1 = tc1
    lc2 = tc2
  else
    lc1 = tc2
    lc2 = tc1
  endif
  lcdiff = strtran(lc1,lc2,space(len(lc2)))
endif
return lcDiff
Glenn


if
>Does anyone know of an existing function, routine, or 3rd-pary product that will show the differences between one character string and another? I'm not totally sure exactly how this would work, but one example follows:
>Original string = "The cat jumped over the fence."
>New string = "The cat jumped over the fence to cross the road."
>Routine would return something like: "to cross the road."
>Etc...
>
>Thanks!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform