Returns a set of IDs for strings that contain the given substring.
322309
def find_string_ids(self, substring, suffix_tree_id, limit=None):
        

        # Find an edge for the substring.
        edge, ln = self.find_substring_edge(substring=substring, suffix_tree_id=suffix_tree_id)

        # If there isn't an edge, return an empty set.
        if edge is None:
            return set()

        # Get all the string IDs beneath the edge's destination node.
        string_ids = get_string_ids(
            node_id=edge.dest_node_id,
            node_repo=self.node_repo,
            node_child_collection_repo=self.node_child_collection_repo,
            stringid_collection_repo=self.stringid_collection_repo,
            length_until_end=edge.length + 1 - ln,
            limit=limit
        )

        # Return a set of string IDs.
        return set(string_ids)
750131
def index(self, sub, *args):
        
        pos = self.find(sub, *args)
        if pos == -1:
            raise ValueError('substring not found')
        return pos
160525
@Override
	public Set<String> getContainedIds() {
		Set<String> s = super.getContainedIds();
		for (Constraint c : map.values()) {
			s.addAll(c.getContainedIds());
		}
		return s;
	}
389235
public StringGrabber substring(int startIdx, int endIndex) {
		if (startIdx < 0) {
			startIdx = 0;
		}
		if (endIndex > length() - 1) {
			endIndex = length() - 1;
		}

		sb = new StringBuilder(substringInternally(startIdx, endIndex));
		return StringGrabber.this;
	}
725236
public String disAssembleId(String id, String... suffixes) {
		int count = 0;
		for (String s : suffixes) {
			count += s.length() + Dom.ID_SEPARATOR.length();
		}
		return id.substring(0, id.length() - count);
	}
366924
def ids(self):
        
        if config().identifiers() == 'text':
            ids = self._id_todo_map.keys()
        else:
            ids = [str(i + 1) for i in range(self.count())]
        return set(ids)
26922
def _ids(self):
        """"""
        for pk in self._pks:
            yield getattr(self, pk)

        for pk in self._pks:

            try:
                yield str(getattr(self, pk))
            except ValueError:
                pass
80868
public static int count(final String string, final String substring)
   {
      int count = 0;
      int idx = 0;

      while ((idx = string.indexOf(substring, idx)) != -1)
      {
         idx++;
         count++;
      }

      return count;
   }
915617
public String substringBetween(String string, String begin, String end, boolean includeBoundaries) {
		if (string == null || begin == null || end == null) {
			return null;
		}
		int startPos = string.indexOf(begin);
		if (startPos != -1) {
			if (includeBoundaries)
				startPos = startPos - begin.length();
			int endPos = string.lastIndexOf(end);
			if (endPos != -1) {
				if (includeBoundaries)
					endPos = endPos + end.length();
				return string.substring(startPos + begin.length(), endPos);
			}
		}
		return null;
	}
80373
def find(self, substring):
        '''
        
        '''
        if isinstance(substring, ByteData):
            substring = substring.to_bytes()
        return self._bytes.find(substring)
284979
public static String substring( final String    str,
                                    final String    beginIndex )
    {
        return str.substring( Integer.valueOf( beginIndex ).intValue() );
    }
25096
public String substring(int beginIndex) {
        if (beginIndex < 0) {
            throw new StringIndexOutOfBoundsException(beginIndex);
        }
        int subLen = size() - beginIndex;
        if (subLen < 0) {
            throw new StringIndexOutOfBoundsException(subLen);
        }
        return (beginIndex == 0) ? toString() : new String(buf, toInternalId(beginIndex), subLen);
    }
489006
def ids2strids(ids: Iterable[int]) -> str:
    
    return C.TOKEN_SEPARATOR.join(map(str, ids))
856104
def get_string(self, stringid):
        '''
        '''
        stringid = int(stringid)
        if not hasattr(self, '_strings'):
            self._strings = {}
        if not stringid in self._strings:
            self._strings[stringid] = self.addon.getLocalizedString(stringid)
        return self._strings[stringid]
1180855
def substring_search(query, list_of_strings, limit_results=DEFAULT_LIMIT):
    

    matching = []

    query_words = query.split(' ')

    # sort by longest word (higest probability of not finding a match)
    query_words.sort(key=len, reverse=True)

    counter = 0

    for s in list_of_strings:

        target_words = s.split(' ')

        # the anyword searching function is separate
        if(anyword_substring_search(target_words, query_words)):
            matching.append(s)

            # limit results
            counter += 1
            if(counter == limit_results):
                break

    return matching
1131660
public List<String> getFilteredIndexList(String containedString) {
        return getAllIndices().stream()
                .filter(index -> index.contains(containedString))
                .collect(toList());
    }
1090373
def substitution_set(string, indexes):
    
    strlen = len(string)
    return {mutate_string(string, x) for x in indexes if valid_substitution(strlen, x)}