Removes trailing zeros
340836
private void trimZeros()
  {
    // loop over ALL_ZEROS_LITERAL words
    int w;
    do {
      w = words[lastWordIndex];
      if (w == ConciseSetUtils.ALL_ZEROS_LITERAL) {
        lastWordIndex--;
      } else if (isZeroSequence(w)) {
        if (simulateWAH || isSequenceWithNoBits(w)) {
          lastWordIndex--;
        } else {
          // convert the sequence in a 1-bit literal word
          words[lastWordIndex] = getLiteral(w);
          return;
        }
      } else {
        // one sequence or literal
        return;
      }
      if (lastWordIndex < 0) {
        reset();
        return;
      }
    } while (true);
  }
968402
private /*@ helper @*/ void trimLeadingZeros() {
        int i = nWords;
        if (i > 0 && (data[--i] == 0)) {
            //for (; i > 0 && data[i - 1] == 0; i--) ;
            while(i > 0 && data[i - 1] == 0) {
                i--;
            }
            this.nWords = i;
            if (i == 0) { // all words are zero
                this.offset = 0;
            }
        }
    }
920602
def _trim_zeros_complex(str_complexes, na_rep='NaN'):
    
    def separate_and_trim(str_complex, na_rep):
        num_arr = str_complex.split('+')
        return (_trim_zeros_float([num_arr[0]], na_rep) +
                ['+'] +
                _trim_zeros_float([num_arr[1][:-1]], na_rep) +
                ['j'])

    return [''.join(separate_and_trim(x, na_rep)) for x in str_complexes]
1139144
def clean_float(v):
    """"""

    if v is None or not str(v).strip():
        return None

    return float(str(v).replace(',', ''))
504679
function removeTrailingZeros(str) {
  if (typeof str != 'string') throw new Error('in removeTrailingZeros, data type mismatch');

  let iNonZero = -1;
  for (let i = str.length - 1; i >= 0; i--) {
    if (charToVal(str[i]) != 0) {
      iNonZero = i; // index of the first nonzero digit from the right.
      break;
    }
  }
  str = str.slice(0, iNonZero + 1); // if 'str' is entirely zeros or is the empty string, gives ''.

  return str;
}
174404
function trimmedLeftIndex(string) {
    var index = -1,
        length = string.length;

    while (++index < length) {
      var c = string.charCodeAt(index);
      if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 160) || c == 5760 || c == 6158 ||
          (c >= 8192 && (c <= 8202 || c == 8232 || c == 8233 || c == 8239 || c == 8287 || c == 12288 || c == 65279)))) {
        break;
      }
    }
    return index;
  }
493092
function removezeros(bin){
  var i = 0;
  while((i < bin.length) && (!bin[i])){i++;}
  if(i == bin.length){
    return filledarray(false, 1);
  }else{
    return bin.slice(i);
  }
}
670952
function cleanValue(val, char) {
  var num;
  var conditions = val.split(' ');
  var i = 0;

  while (!num && i < conditions.length) {
    if (conditions[i].indexOf(char) > -1) {
      num = conditions[i].replace(/<|>|~/g, '');
    }
    i++;
  }

  return parseFloat(num);
}
753467
private function removeTrailingZeroesIfNeeded()
    {
        $exponent = $this->getExponent();
        $coefficient = $this->getCoefficient();

        // trim trailing zeroes from the fractional part
        // for example 1000e-1 => 100.0
        if (0 < $exponent && '0' === substr($coefficient, -1)) {
            $fractionalPart = $this->getFractionalPart();
            $trailingZeroesToRemove = 0;
            for ($i = $exponent - 1; $i >= 0; $i--) {
                if ('0' !== $fractionalPart[$i]) {
                    break;
                }
                $trailingZeroesToRemove++;
            }

            if ($trailingZeroesToRemove > 0) {
                $this->coefficient = substr($coefficient, 0, -$trailingZeroesToRemove);
                $this->exponent = $exponent - $trailingZeroesToRemove;
            }
        }
    }
1198842
def clean(cls, cpf):
        
        """
        if isinstance(cpf, six.string_types):
            cpf = int(re.sub('[^0-9]', '', cpf))

        return '{0:011d}'.format(cpf)
1162155
function trim(text) {
  var MAX_INDENT = 9999;
  var empty = RegExp.prototype.test.bind(/^\s*$/);
  var lines = text.split('\n');
  var minIndent = MAX_INDENT;
  var indentRegExp;
  var ignoreLine = (lines[0][0] != ' '  && lines.length > 1);
  // ignore first line if it has no indentation and there is more than one line

  lines.forEach(function(line){
    if (ignoreLine) {
      ignoreLine = false;
      return;
    }

    var indent = line.match(/^\s*/)[0].length;
    if (indent > 0 || minIndent == MAX_INDENT) {
      minIndent = Math.min(minIndent, indent);
    }
  });

  indentRegExp = new RegExp('^\\s{0,' + minIndent + '}');

  for ( var i = 0; i < lines.length; i++) {
    lines[i] = lines[i].replace(indentRegExp, '');
  }

  // remove leading lines
  while (empty(lines[0])) {
    lines.shift();
  }

  // remove trailing
  while (empty(lines[lines.length - 1])) {
    lines.pop();
  }
  return lines.join('\n');
}
1317976
def trim_decimals(s, precision=-3):
        
        encoded = s.encode('ascii', 'ignore')
        str_val = ""
        if six.PY3:
            str_val = str(encoded, encoding='ascii', errors='ignore')[:precision]
        else:
            # If precision is 0, this must be handled seperately
            if precision == 0:
                str_val = str(encoded)
            else:
                str_val = str(encoded)[:precision]
        if len(str_val) > 0:
            return float(str_val)
        else:
            return 0
1243051
def _remove_trailing_empty_p(self):
        
        block_items = list(self.iter_block_items())
        last_content_elm = block_items[-1]
        if last_content_elm.tag != qn('w:p'):
            return
        p = last_content_elm
        if len(p.r_lst) > 0:
            return
        self.remove(p)
973344
def drop_trailing_zeros(num):
    
    txt = '%f' %(num)
    txt = txt.rstrip('0')
    if txt.endswith('.'):
        txt = txt[:-1]
    return txt
874503
function removeTrailingSlashes(s) {
	if (s.startsWith("/"))
		s = s.slice(1);
	if (s.endsWith("/"))
		s = s.slice(0, -1);
	return s; //.replace(/\/\//g, "/");
}
52192
def normalize_value(value):
	""""""

	value = str(value)
	value = value.casefold()

	value = re.sub(r'\/\s*\d+', '', value)  # Remove "/<totaltracks>" from track number.
	value = re.sub(r'^0+([0-9]+)', r'\1', value)  # Remove leading zero(s) from track number.
	value = re.sub(r'^(\d+)\.+', r'\1', value)  # Remove dots from track number.
	value = re.sub(r'[^\w\s]', '', value)  # Remove leading non-word characters.
	value = re.sub(r'^the\s+', '', value)  # Remove leading "the".
	value = re.sub(r'^\s+', '', value)  # Remove leading spaces.
	value = re.sub(r'\s+$', '', value)  # Remove trailing spaces.
	value = re.sub(r'\s+', ' ', value)  # Reduce multiple spaces to a single space.

	return value
244179
function clean(value) {
  if (value === null || value === undefined) {
    return ''
  }

  return trim(
    collapse(String(value).replace(/[\u0021-\u0040]+/g, ' '))
  ).toLowerCase()
}