I have the following:
InputStream inputFromServer
TextArea t
String display
String validation
String display holds the data from the inputstream, it then adds it to the text area. I want to check that if display contains validation then dont write it to the text area. Here is the code I currently have:
while ((inputFromServer.read())!=-1)
{
display = display + ((char)inputFromServer.read());
t.setText(s);
}
I want something like:
while ((inputFromServer.read())!=-1)
{
display = display + ((char)inputFromServer.read());
if display contains validation {
THEN DONT WRITE IT TO THE TEXT AREA
}
else{
t.setText(s);
}
}
If the method is completely wrong then can someone guide me in the right direction please? Thanks
You could do like this: