java - Looking Up Quotation marks with a array of Strings -
so have following string: dog "and" cat split array named: array1 with,
{'d','o','g',' ','"','c','a',t','"'}
boolean works = false; (int i=0; < array1.length;i++){ if (array1[i].equals("d"){ if (array1[i+1].equals("o"){ if(array1[i+2].equals("g"){ if (array1[i+3].equals(" "){ if (array1[i+4].equals("""){ //does work here if (array1[i+5].equals("c"){ if (array1[i+6].equals("a"){ if (array1[i+7].equals("t"){ works = true; } } } } } } } } } system.out.println(works);
it doesnt work @ equals quotations. have ideas?
i try simplify code, example write
string s = "dog \"and\" cat"; boolean works = s.contains("dog \"cat");
this makes more obvious works false.
Comments
Post a Comment