Replaces the last 1/4 of a string with X's
354619
def _serial_sanitizer(instr):
    ''''''
    length = len(instr)
    index = int(math.floor(length * .75))
    return '{0}{1}'.format(instr[:index], 'X' * (length - index))
1081362
function (fromString) {
                    var matches = fromString.match(/(\${.*?})/g);
                    if (matches != null) {
                        for (var i = 0; i < matches.length; i++) {
                            var val = values[matches[i].substring(2, matches[i].length - 1)] || "";
                            if (val != null) {
                                fromString = fromString.replace(matches[i], val);
                            }
                        }
                    }
                    return fromString;
                }
1362853
function trim(str, targetStr) {
    var retStr = "";
    var regStr;

    if (typeof str != "string") {
        return retStr;
    }

    if (typeof targetStr != "string" || !targetStr) {
        targetStr = "\\s";
    }

    regStr = "^" + targetStr + "*(.*?)" + targetStr + "*$";
    regStr = new RegExp(regStr);

    str = str.replace(regStr, "$1");
    return str;
}
110877
function strSplice(str, index, count, add) {
  return str.slice(0, index) + add + str.slice(index + count);
}
302289
private static int jsSplitMatch(String stringValue, int startIndex,
                                  String separator) {

    if (startIndex + separator.length() > stringValue.length()) {
      return -1;
    }

    int matchIndex = stringValue.indexOf(separator, startIndex);

    if (matchIndex < 0) {
      return -1;
    }

    return matchIndex;
  }
131400
def _str_replace(txt):
        """"""
        txt = txt.replace(",", "")
        txt = txt.replace(" ", "_")
        txt = txt.replace(":", "")
        txt = txt.replace(".", "")
        txt = txt.replace("/", "")
        txt = txt.replace("", "")
        return txt
216584
def right_replace(string, old, new, count=1):
    
    if not string:
        return string
    return new.join(string.rsplit(old, count))
746797
def strip_spaces(x):
    
    x = x.replace(b' ', b'')
    x = x.replace(b'\t', b'')
    return x
1275053
function toFixedWidth(value, maxChars) {
	var result = value.toFixed(2).substr(0, maxChars);
	if (result[result.length - 1] == '.') {
		result = result.substr(0, result.length - 2) + ' ';
	}
	return result;
}
895131
function replaceAll(str, find, replace) {
	let s = '',
		index,
		next;
	while (~(next = str.indexOf(find, index))) {
		s += str.substring(index, next) + replace;
		index = next + find.length;
	}
	return s + str.substring(index);
}
1045399
def truncatechars(value,arg=50): 
    '''
    
    ''' 
    arg = int(arg) 
    if arg < len(value): 
        half = (arg-3)/2 
        return "%s...%s" % (value[:half],value[-half:]) 
    return value
183536
def trunc_str(s: str) -> str:
    """"""
    if len(s) > max_str_size:
        i = max(0, (max_str_size - 3) // 2)
        j = max(0, max_str_size - 3 - i)
        s = s[:i] + "..." + s[-j:]
    return s
647621
function toFixedString (str, digits) {
  var nums = ('' + toFixedNumber(str, digits)).split('.')
  return digits ? [nums[0], '.', XEUtils.padEnd(nums[1] || '', digits, '0')].join('') : nums[0]
}
1337135
function replace(val1, val2) {
      var l = last.call(this);
      l.replacePartial1 = val1;
      l.replacePartial2 = val2;
      return this;
    }
266535
function dotsplit (string) {
  var idx = -1
  var str = compact(normalize(string).split('.'))
  var end = str.length
  var out = []

  while (++idx < end) {
    out.push(todots(str[idx]))
  }

  return out
}
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;
  }
65552
def _normalize(self, string):
		'''  '''

		string = string.replace(u'\xa0', '')
		string = string.strip()
		return string