salve,
ecco il mio problema:
ho due stringhe (che rappresentano due indirizzi). esiste un algoritmo collaudato per il confronto delle due, cioè se la prima stringa è contenuta nella seconda ??
faccio un esempio:

a: Via Roma Milano 20000
b: Via Roma Milano 20000 IT

come si può notare la stringa a è contenuta in b ma se

a: Via Rom Milano 20000
b: Via Roma Milano 20000 IT

la stringa a NON è contenuta in b.

In pratica vorrei realizzare un sistema che controlla che ogni parola di a è contenuta in b. Importante è che non deve tenere conto della posizione.
Vi faccio vedere quello che ho realizzato io:


Codice PHP:
        String[] awords a.split(" ");
        
String[] bwords b.split(" ");
        
// perform the comparison
        
for (int i=2i<awords.lengthi++) {
            
awords[i] = d.getCityIT(awords[i]);
        }
        
Boolean reply false;
        for (
int i=0i<awords.length && !replyi++) {
            
reply true;
            for (
int j=0j<bwords.length && replyj++) {
                if (!
awords[i].equals(bwords[j])){
                    
reply true;
                }else
                    
reply false;
            }
        }
        return (
reply);
      } 
Grazie a tutti.
ciao

mauro