private bool isIncluded(String hosts, String host) { int i = 0; int hostlen = host.Length; int hostslen = hosts.Length; int j; while (i < hostslen) { j = hosts.IndexOf(',', i); if (j == -1) { if (hostlen != hostslen - i) { return(false); } return(StringAux.regionMatches(hosts, true, i, host, 0, hostlen)); //return hosts.substring(i).equals(host); } if (hostlen == (j - i)) { if (StringAux.regionMatches(hosts, true, i, host, 0, hostlen)) { return(true); } //if(hosts.substring(i, i+hostlen).equals(host)) return true; } i = j + 1; } return(false); }