code: private void removeSpan(Editable text, TokenImageSpan span) {
          //We usually add whitespace after a token, so let's try to remove it as well if it's present
          int end = text.getSpanEnd(span);
          if (end < text.length() && text.charAt(end) == ' ') {
              end += 1;
          }
  
          internalEditInProgress = true;
          text.delete(text.getSpanStart(span), end);
          internalEditInProgress = false;
  
          if (allowCollapse && !isFocused()) {
              updateCountSpan();
          }
      }
docs: Remove a span from the current EditText and fire the appropriate callback
  
  @param text Editable to remove the span from
  @param span TokenImageSpan to be removed