Remove preceding and trailing whitespace from all cells. By default, Table does not
 strip whitespace from cells.
432233
def strip!
      rows.each do |row|
        columns.each do |column|
          value = row[column.key]
          if value.respond_to?(:strip)
            row[column.key] = value.strip
          elsif value.is_a?(Float)
            row[column.key] = strip_decimal(value)
          end
        end
      end
    end
1140902
def _skip_whitespace(self):
        """"""
        i = 0
        while self._cur_token['type'] is TT.ws and not self._finished:
            self._increment()
            i += 1

        return i
1261031
private void skipWhitespace()
    {
        while (ivPos < ivString.length() && Character.isWhitespace(ivString.charAt(ivPos)))
        {
            ivPos++;
        }
    }
369190
def clean_whitespace(string, compact=False):
    """"""
    for a, b in (('\r\n', '\n'), ('\r', '\n'), ('\n\n', '\n'),
                 ('\t', ' '), ('  ', ' ')):
        string = string.replace(a, b)
    if compact:
        for a, b in (('\n', ' '), ('[ ', '['),
                     ('  ', ' '), ('  ', ' '), ('  ', ' ')):
            string = string.replace(a, b)
    return string.strip()
746797
def strip_spaces(x):
    
    x = x.replace(b' ', b'')
    x = x.replace(b'\t', b'')
    return x
1305314
def _clean_text(self, text):
        """"""
        output = []
        for char in text:
            cp = ord(char)
            if cp in (0, 0xfffd) or self._is_control(char):
                continue
            if self._is_whitespace(char):
                output.append(' ')
            else:
                output.append(char)
        return ''.join(output)
946028
public function skipWhitespace(): void
    {
        if (preg_match('/\h+/A', $this->data, $match, 0, $this->cursor)) {
            $this->char += mb_strlen($match[0]);
            $this->cursor += \strlen($match[0]);
        }
    }
43924
function trimTrailingWhitespace(index, nextTag) {
    for (var endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
      var str = buffer[index];
      var match = str.match(/^<\/([\w:-]+)>$/);
      if (match) {
        endTag = match[1];
      }
      else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
        break;
      }
    }
  }
201331
function removeWhitespaceError(node) {
            const locStart = node.loc.start;
            const locEnd = node.loc.end;

            errors = errors.filter(({ loc: errorLoc }) => {
                if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
                    if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) {
                        return false;
                    }
                }
                return true;
            });
        }
225305
def sanitize_cells(rows)
      rows.map do |cells|
        cells.map do |cell|
          cell ? cell.strip : ""
        end
      end
    end
550838
function(elem) {
		if (elem) {
			while (isWhitespace(elem.firstChild)) {
				// trim leading whitespace text nodes
				elem.removeChild(elem.firstChild);
			}
			// trim leading whitespace text
			trimPattern(elem.firstChild, LEADING);
			while (isWhitespace(elem.lastChild)) {
				// trim trailing whitespace text nodes
				elem.removeChild(elem.lastChild);
			}
			// trim trailing whitespace text
			trimPattern(elem.lastChild, TRAILING);
		}
	}
1057755
function trimTrailingWhitespacesForRemainingRange() {
                var startPosition = previousRange ? previousRange.end : originalRange.pos;
                var startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line;
                var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line;
                trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange);
            }
531293
public static void stripWhitespaceNodes(Node element) {
        Node node, child;
        for (child = element.getFirstChild(); child != null; child = node) {
            node = child.getNextSibling();
            stripWhitespaceNodes(child);
        }

        if (element.getNodeType() == Node.TEXT_NODE && element.getNodeValue().trim().length()==0) {
            element.getParentNode().removeChild(element);
        }
    }
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()
1181624
def clean_cell(self, cell, cell_type):
        
        try:
            # Get rid of non-ASCII characters
            cell = cell.encode('ascii', 'ignore').decode()
            if cell_type == 'D':
                cell = datetime.strptime(cell, '%Y%m%d')
            elif cell_type == 'I':
                cell = int(cell)
            elif cell_type == 'N':
                cell = Decimal(cell)
            else:
                cell = cell.upper()

                if len(cell) > 50:
                    cell = cell[0:50]

                if not cell or cell in NULL_TERMS:
                    cell = None

        except:
            cell = None

        return cell
632231
def delete_horizontal_space(event):
    "  "
    buff = event.current_buffer
    text_before_cursor = buff.document.text_before_cursor
    text_after_cursor = buff.document.text_after_cursor

    delete_before = len(text_before_cursor) - len(text_before_cursor.rstrip('\t '))
    delete_after = len(text_after_cursor) - len(text_after_cursor.lstrip('\t '))

    buff.delete_before_cursor(count=delete_before)
    buff.delete(count=delete_after)
875364
private int skipWhiteSpace(byte[] data, int start) {
        int index = start;
        while (index < data.length && (' ' == data[index] || '\t' == data[index])) {
            index++;
        }
        return index;
    }