Remove the inserted character(s).
544372
def reverseCommit(self):
        

        # Move the cursor to the right of the text to delete.
        tc = self.qteWidget.textCursor()

        # Delete as many characters as necessary. For an image that would
        # be exactly 1 even though the HTML code to embed that image is usually
        # longer. For text, it would be as many characters as the pasted text
        # was long.
        if self.isImage:
            dataLen = 1
        else:
            dataLen = len(self.data)

        tc.setPosition(self.selStart + dataLen, QtGui.QTextCursor.MoveAnchor)
        for ii in range(dataLen):
            tc.deletePreviousChar()

        # Add the previously selected text (this may be none).
        tc.insertHtml(self.selText)
        self.qteWidget.setTextCursor(tc)
791285
def escape_chars(text, chars):
    """"""
    text = str(text)
    chars = list(set(chars))
    if '\\' in chars:
        chars.remove('\\')
        chars.insert(0, '\\')
    for ch in chars:
        text = text.replace(ch, '\\' + ch)
    return text
1143539
private function trimSpecialsChars($s)
    {
        if (count($this->getNotReplacedChars()) == 0) {
            $reg = '~[^-a-z0-9_]+~';
        } else {
            $reg = '~[^-a-z0-9_' . implode('', $this->getNotReplacedChars()) .']+~';
        }
        return preg_replace($reg, '', $s);
    }
1142699
def slugify(s):
    
    s = strip_accents(s.replace("'", '').lower())
    return re.sub('[^a-z0-9]+', ' ', s).strip().replace(' ', '-')
671494
def clean(string):
    '''  '''
    # manual fixes in the source
    # 24/1.png
    # 9/1.png
    # 3/1.png
    #if ')' in string:  # fix in the source data
        #string = string.split(')')[0] + ')'  # remove trailing garbage
    return (string
            .replace('_', '')
            .replace('-', '')
            .replace('—', '')
            .replace('.', '')
            .replace('=', '')
            .replace('\u2018',"'")  # LEFT SINGLE QUOTATION MARK
            .replace('\u2019', "'")  # RIGHT SINGLE QUOTATION MARK
            .strip())
749858
public void removeBlockQuotePrefix ()
  {
    Line aLine = m_aLines;
    while (aLine != null)
    {
      if (!aLine.m_bIsEmpty)
      {
        if (aLine.m_sValue.charAt (aLine.m_nLeading) == '>')
        {
          int rem = aLine.m_nLeading + 1;
          if (aLine.m_nLeading + 1 < aLine.m_sValue.length () && aLine.m_sValue.charAt (aLine.m_nLeading + 1) == ' ')
            rem++;
          aLine.m_sValue = aLine.m_sValue.substring (rem);
          aLine.initLeading ();
        }
      }
      aLine = aLine.m_aNext;
    }
  }
133279
public void skipWhitespaces() {
    for (int i = mark; i < chars.length; i++) {
      if (Character.isWhitespace(chars[i])) {
        mark++;
      } else {
        break;
      }
    }
  }
1220573
def clean_chars(value):
    ""
    value = value.replace('\xb9', ' ')
    value = value.replace('\xf8', ' ')
    value = value.replace('\xab', ' ')
    value = value.replace('\xa7', ' ')
    value = value.replace('\xa8', ' ')
    value = value.replace('\xfb', ' ')
    value = value.replace('\xfc', ' ')
    return value
1056826
def sanitize_jid(s):
    """"""
    jid = unicode_to_ascii(s).lower()
    jid = WHITESPACE.sub('-', jid)
    jid = INVALID_JID_CHARS.sub('', jid)
    return jid.strip()[:256]
489503
def remove_unsafe_chars(text):
    """"""
    if isinstance(text, six.string_types):
        text = UNSAFE_RE.sub('', text)
    return text
1032679
def remove_trailing_spaces(self, index=None):
        """"""
        if index is None:
            index = self.get_stack_index()
        finfo = self.data[index]
        finfo.editor.remove_trailing_spaces()
567180
def _remove_accents(self, input_str):
        
        nkfd_form = unicodedata.normalize('NFKD', input_str)
        return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])
630214
def del_character(self, name):
        
        self.query.del_character(name)
        self.del_graph(name)
        del self.character[name]
289749
def remove_nullchars(block):
    """"""
    data = block.lstrip(b'\00')

    padding = b'\00' * ((len(block) - len(data)) % 8)

    return padding + data
702335
def sanitize(string):
    
    replace_chars = [
        ['\\', '-'], [':', '-'], ['/', '-'],
        ['?', ''], ['<', ''], ['>', ''],
        ['`', '`'], ['|', '-'], ['*', '`'],
        ['"', '\''], ['.', ''], ['&', 'and']
    ]
    for ch in replace_chars:
        string = string.replace(ch[0], ch[1])
    return string
525637
private static String replaceInvalidChars(String substring) {
        StringBuilder builder = new StringBuilder();
        for(char c : substring.toCharArray()) {
            if(c < 32) {
                builder.append('.');
            } else {
                builder.append(c);
            }
        }
        return builder.toString();
    }
1134709
function removeUnwantedCharacters(cleanedString, unwantedCharArray) {
    for (var x = 0; x < unwantedCharArray.length; x++) {
        var unwantedCharRegExp = new RegExp(unwantedCharArray[x], 'g');
        cleanedString = cleanedString.replace(unwantedCharRegExp, '');
    }
    return cleanedString;
}