Quote:
Originally Posted by bullet1
Code:
String items = _perso.getItemsIDSplitByChar(";"); // it's the function that take the value of the field and separate the IDS by ";"
String[] item = items.split(";");
String id = "141375";
for (int i = 0; i < item.length; i++)
{
if (item[i] != null && item[i].equals(id)) {
SocketManager.GAME_SEND_MESSAGE(_perso, "You have the item", Ancestra.COLOR_BLEU2);
break;
}
else
{
SocketManager.GAME_SEND_MESSAGE(_perso, "You don't have the item", Ancestra.COLOR_ERROR);
break;
}
I doesn't work :/
|
Split uses regex, not literal strings, try this:
.split("[; ]")