PDA

View Full Version : [JAvA] cercare una stringa in una stringa


blackknight
20-10-2005, 17:32
Ciao a tutti,qualcumo mi suggerisce il modo per cercare una stringa in una stringa + lunga?Mi spiego meglio io devo implementare un algoritmo di ricerca in un mio piccolo progetto.In pratica data una stringa devo ricercare tutti i campi di un database MySql che la contengono.Come posso fare?

Giakino
20-10-2005, 18:30
contains

public boolean contains(CharSequence s)

Returns true if and only if this string contains the specified sequence of char values.

Parameters:
s - the sequence to search for
Returns:
true if this string contains s, false otherwise
Throws:
NullPointerException - if s is null
Since:
1.5

blackknight
20-10-2005, 19:11
contains

public boolean contains(CharSequence s)

Returns true if and only if this string contains the specified sequence of char values.

Parameters:
s - the sequence to search for
Returns:
true if this string contains s, false otherwise
Throws:
NullPointerException - if s is null
Since:
1.5
:D grazie...mi sa che sono proprio fuso...