/** Gets the index of the first occurence of any string of array <i>ss</i> ignoring case. */ public int indexOfIgnoreCase(String[] ss) { Parser par = new Parser(str, index); while (par.hasMore()) { if (par.startsWithIgnoreCase(ss)) return par.getPos(); else par.skipChar(); } return -1; }
/** Removes specified parameter (if present) */ public void removeParameter(String name) { int index = url.indexOf(';'); if (index < 0) return; Parser par = new Parser(url, index); while (par.hasMore()) { int begin_param = par.getPos(); par.skipChar(); if (par.getWord(SipParser.param_separators).equals(name)) { String top = url.substring(0, begin_param); par.goToSkippingQuoted(';'); String bottom = ""; if (par.hasMore()) bottom = url.substring(par.getPos()); url = top.concat(bottom); return; } par.goTo(';'); } }
/** Gets the begin of next line */ public int indexOfNextLine() { Parser par = new Parser(str, index); par.goToNextLine(); int i = par.getPos(); return (i < str.length()) ? i : -1; }