code: public int span(CharSequence s, int start, SpanCondition spanCondition) {
          int end = s.length();
          if (start < 0) {
              start = 0;
          } else if (start >= end) {
              return end;
          }
          if (bmpSet != null) {
              // Frozen set without strings, or no string is relevant for span().
              return bmpSet.span(s, start, spanCondition, null);
          }
          if (stringSpan != null) {
              return stringSpan.span(s, start, spanCondition);
          } else if (!strings.isEmpty()) {
              int which = spanCondition == SpanCondition.NOT_CONTAINED ? UnicodeSetStringSpan.FWD_UTF16_NOT_CONTAINED
                      : UnicodeSetStringSpan.FWD_UTF16_CONTAINED;
              UnicodeSetStringSpan strSpan = new UnicodeSetStringSpan(this, new ArrayList<String>(strings), which);
              if (strSpan.needsStringSpanUTF16()) {
                  return strSpan.span(s, start, spanCondition);
              }
          }
  
          return spanCodePointsAndCount(s, start, spanCondition, null);
      }
docs: Span a string using this UnicodeSet.
  If the start index is less than 0, span will start from 0.
  If the start index is greater than the string length, span returns the string length.
  <p>To replace, count elements, or delete spans, see {@link android.icu.text.UnicodeSetSpanner UnicodeSetSpanner}.
  @param s The string to be spanned
  @param start The start index that the span begins
  @param spanCondition The span condition
  @return the string index which ends the span (i.e. exclusive)