def substr(self, start=None, end=None, count=None):
        """Extracts the specified substring from this expression, which must
        resolve to a string.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz
            from fiftyone import ViewField as F

            dataset = foz.load_zoo_dataset("quickstart")

            # Truncate the `label` of each prediction to 3 characters
            truncate_label = F().set_field("label", F("label").substr(count=3))
            view = dataset.set_field(
                "predictions.detections",
                F("detections").map(truncate_label),
            )

            print(view.distinct("predictions.detections.label"))

        Args:
            start (None): the starting index of the substring. If negative,
                specifies an offset from the end of the string
            end (None): the ending index of the substring. If negative,
                specifies an offset from the end of the string
            count (None): the substring length to extract. If ``None``, the
                rest of the string is returned

        Returns:
            a :class:`ViewExpression`
        """
        if start is None and end is None and count is None:
            return self

        if start is None:
            start = 0

        if start < 0 and end is not None and end < 0:
            count = end - start
            end = None

        if start < 0:
            start += self.strlen()

        if end is not None:
            if end < 0:
                end += self.strlen()

            count = end - start
        elif count is None:
            count = -1

        expr = ViewExpression({"$substrBytes": [self, start, count]})
        return self.let_in(expr)
Extracts the specified substring from this expression, which must
        resolve to a string.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz
            from fiftyone import ViewField as F

            dataset = foz.load_zoo_dataset("quickstart")

            # Truncate the `label` of each prediction to 3 characters
            truncate_label = F().set_field("label", F("label").substr(count=3))
            view = dataset.set_field(
                "predictions.detections",
                F("detections").map(truncate_label),
            )

            print(view.distinct("predictions.detections.label"))

        Args:
            start (None): the starting index of the substring. If negative,
                specifies an offset from the end of the string
            end (None): the ending index of the substring. If negative,
                specifies an offset from the end of the string
            count (None): the substring length to extract. If ``None``, the
                rest of the string is returned

        Returns:
            a :class:`ViewExpression`
        
fiftyone/core/expressions.py