Searches the input until a string is found and discards all input up to
and including the matched string.
334733
function (str) {
      var index = this.html.indexOf(str, this.currentChar) + str.length;
      if (index === -1)
        this.currentChar = this.html.length;
      this.currentChar = index;
    }
1074914
private String truncateAt(final String input, final String searchString) {
        final int i = input.indexOf(searchString);
        if (i != -1) {
            return input.substring(0, i);
        }
        return input;
    }
699908
function endsWith(target, searchString, position) {
  position = position || target.length;
  position = position - searchString.length;
  let lastIndex = target.lastIndexOf(searchString);
  return lastIndex !== -1 && lastIndex === position;
}
1199450
private static String filterValue(String value) 
            throws IOException {
        InternalStringBuilder result = new InternalStringBuilder(value.length());
        
        for (int i = 0; i < value.length(); ++i) {
            char c = value.charAt(i);
            switch (c) {
                case '<':
                    result.append("&lt;");
                    break;
                case '>':
                    result.append("&gt;");
                    break;
                case '&':
                    result.append("&amp;");
                    break;
                default:
                    result.append(c);
            }
        }
        
        return result.toString();
    }
646287
function handleSearchText(searchText, previousSearchText) {
      self.index = -1;
      // do nothing on init
      if (searchText === previousSearchText) return;
      else if (self.selectedItem && self.displayProperty1) {
        setLoading(false);
        if (self.selectedItem[self.displayProperty1] !== searchText) {
          self.selectedItem = null;
          self.hidden = shouldHide();
          if (self.itemList && self.itemListCopy) {
            self.itemList = angular.copy(self.itemListCopy);
          }
        }
      }
      else if (self.remoteMethod) {
        fetchResults(searchText);
      }
      else if (self.itemList) {
        self.itemList = $filter('filter')(self.itemListCopy, searchText);
      }
    }
537088
private boolean forwardMatch(String match, boolean ignoreCase, boolean resetOnTrue)
      throws
      IOException
  {
    Mark mark = reader.mark();
    List<Integer> cbuf = Lists.newArrayList();
    StringBuilder builder = new StringBuilder();

    boolean result = true;
    boolean seenChar = false;

    while (true)
    {
      cbuf.add(reader.next());

      char ch = (char) reader.curChar;

      if (reader.curChar == -1)
      {
        result = false;
        break;
      }
      else if (WHITESPACE.matches(ch))
      {
        if (seenChar)
        {
          builder.append(ch);
        }
      }
      else
      {
        if (builder.length() == 0)
        {
          seenChar = true;
        }
        builder.append(ch);
        int index = builder.length() - 1;

        if (!ignoreCase
            && (builder.charAt(index) == match.charAt(index)))
        {
          result = false;
          break;
        }

        if (ignoreCase
            && (Ascii.toLowerCase(builder.charAt(index)) != Ascii
            .toLowerCase(match.charAt(index))))
        {
          result = false;
          break;
        }
      }

      if (builder.length() == match.length())
      {
        if (!match.equalsIgnoreCase(builder.toString()))
        {
          result = false;
        }
        break;
      }
    }

    if (!result || resetOnTrue)
    {
      reader.unread(cbuf, mark);
    }

    return result;
  }
1251879
function (str, findChar, start) {
            var index = str.indexOf(findChar, start);
            while (index != -1) {
                if (!this.isEscaped(str, index)) {
                    return index;
                }
                // continue search after escaped character
                index = str.indexOf(findChar, index + 1);
            }
            return -1;
        }
1199011
private static String strip(String in) {
        if (in == null) {
            return null;
        }
        String out = in.trim();
        if (out.length() == 0) {
            return null;
        } else {
            return out;
        }
    }
234386
public static String[] removeDuplicates(String[] input)
    {
        if (input != null)
        {
            if (input.length > 0)
            {
                Set<String> inputSet = new HashSet<String>(Arrays.asList(input));
                if (inputSet.size() > 0)
                {
                    return inputSet.toArray(new String[inputSet.size()]);
                }
            }
        }
        return null;
    }
578014
public static void replace(final String string, final String find, final String replacement, final Appendable out) throws IOException {
		int pos = string.indexOf(find);
		//System.out.println(string+": "+find+" at "+pos);
		if (pos == -1) {
			out.append(string);
		} else {
			int lastpos = 0;
			final int findLen = find.length();
			do {
				out.append(string, lastpos, pos).append(replacement);
				lastpos = pos + findLen;
				pos = string.indexOf(find, lastpos);
			} while (pos != -1);
			int len = string.length();
			if(lastpos<len) out.append(string, lastpos, len);
		}
	}
1182518
def clear_input_buffer(self):
        
        if hasattr(self.stdin, 'isatty') and self.stdin.isatty():
            if os.name == 'nt':
                while msvcrt.kbhit():
                    msvcrt.getch()
            else:
                try:
                    self.stdin.seek(0, 2)  # may fail in some unseekable file object
                except IOError:
                    pass
1162838
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) {

		if( checkSource ) {
			if( checkDestination ) {
				processSource(matches, numSource, firstPass);
				processDestination(firstPass,numDestination,pruned);
			} else {
				processSource(matches, numSource, pruned);
			}
		} else if( checkDestination ) {
			processDestination(matches,numDestination,pruned);
		} else {
			// well this was pointless, just return the input set
			pruned = matches;
		}
	}
1235275
private String cleanUpString(String text) {
    if (StringUtils.isEmpty(text)) {
      return text;
    }
    else {
      return CONTROL_CHARS.matcher(text).replaceAll("");
    }
  }
1090856
private void parse(String input) {
        char[] data = input.toCharArray();
        int start = 0;
        int hard_stop = data.length - 1;
        while (start < data.length) {
            if (this.mySep == data[start]) {
                start++;
                continue;
            }
            // look for the '=', end of data, or the separator
            int end = start;
            String key = null;
            boolean insideQuotes = false;
            while (end < data.length) {
                boolean extract = false;
                if ('"' == data[end]) {
                    insideQuotes = !insideQuotes;
                } else if (this.mySep == data[end]) {
                    extract = true;
                    end--;
                } else if ('=' == data[end]) {
                    // found a key
                    key = extractString(data, start, end - 1);
                    end++; // past the '='
                    start = end;
                    continue;
                }
                // if we're on the last character then always extract and quit
                if (end == hard_stop) {
                    extract = true;
                }

                // if we need to, extract the value and continue
                if (extract) {
                    String value = extractString(data, start, end);
                    if (null == key) {
                        addElement(value);
                    } else {
                        addElement(key, value);
                    }
                    // at this point, end is pointing to the last char of the val
                    end = end + 2; // jump past delim
                    start = end;
                    if (!insideQuotes) {
                        break; // out of while
                    }
                    continue;
                }
                end++;
            }
        }
    }
481280
public static boolean isLong(String input) {
        try {
            Long.parseLong(input);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
327884
private boolean matchCheck(int upperRange, int s, int prev, boolean interrupt) throws InterruptedException {
        if (Config.USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE) {
            if (Config.USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE) {
                //range = upperRange;
                if (matchAt(upperRange, s, prev, interrupt) != -1) {
                    if (!isFindLongest(regex.options)) return true;
                }
            } else {
                //range = upperRange;
                if (matchAt(upperRange, s, prev, interrupt) != -1) return true;
            }
        } else {
            if (Config.USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE) {
                if (matchAt(end, s, prev, interrupt) != -1) {
                    //range = upperRange;
                    if (!isFindLongest(regex.options)) return true;
                }
            } else {
                //range = upperRange;
                if (matchAt(end, s, prev, interrupt) != -1) return true;
            }
        }
        return false;
    }
716276
private String stripPrefix(final String input, final String searchString) {
        return input.substring(searchString.length(), input.length()).trim();
    }