Change a letter / Replace a letter / Overwrite a letter
in
Programming Questions
•
7 months ago
Hi ,
I'm trying to interact with letter of a text.
I'm first trying to recognize a word and overwrite it , but i'm using the a.equals(b) stuff which is not really appropriate in my case.
In this case , i'll write my text in the String t variable , then i want to say :
If String t CONTAIN word [] ( all the word in the word [] array ) so the background turn to green.
But i don't know what can i use to say if string t contain word [] , something happens...
I'm trying to interact with letter of a text.
I'm first trying to recognize a word and overwrite it , but i'm using the a.equals(b) stuff which is not really appropriate in my case.
In this case , i'll write my text in the String t variable , then i want to say :
If String t CONTAIN word [] ( all the word in the word [] array ) so the background turn to green.
But i don't know what can i use to say if string t contain word [] , something happens...
- /*
*/
//GLOBALS//
String [] word = new String[2];
String t ="c'est ici";
//SETUP//
void setup() {
size(400, 400);
background(0);
smooth();
word[0]="ici";
text(t, 20, 20, 300, 100);
if (t.equals(word[0])) {
background(0, 255, 0);
fill(255);
}
}
//DRAW//
void draw() {
}
//FUNCTIONS//
1