Find two-character vacancies of a string; currently unused
@param {string} str
@param {number} [size]
@returns {string[]}
488472
function findDoubleVacancies(str, size) {
    var vacs = [];
    for (var i = 0; i < CANDIDATE_CHARS.length; i++) {
        for (var j = 0; j < CANDIDATE_CHARS.length; j++) {
            if (i != j) {
                var pair = CANDIDATE_CHARS[i] + CANDIDATE_CHARS[j];
                if (str.indexOf(pair) < 0) {
                    vacs.push(pair);
                    if (size && vacs.length >= size) break;
                }
            }
        }
    }
    return vacs;
}
93342
function listParser(str) {
	var list = str.split(',');
	for (var i = 0; i < list.length; i++)
		list[i] = list[i].replace(/(^\s?)|(\s?$)/g, '');
	return list;
}
850037
function applyReplacements(str, replacements) {
    var result = "",
        replacement,
        i;

    for (i = 0; i < replacements.length; i++) {
        replacement = replacements[i];
        if (replacement) {
            result += replacement.newStr;
            i += replacement.oldStr.length - 1;
        } else {
            result += str.charAt(i);
        }
    }

    result += str.substr(i, str.length);

    return result;
}
77359
function stringTrim (str) {
  return str && str.trim ? str.trim() : stringTrimRight(stringTrimLeft(str))
}
1310936
function(str) {
		if (!str) {
			return str;
		}
		return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, '');
	}
78426
public static List<String> split(final CharSequence str, final int size) {
        if (size < 1) {
            throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero");
        }

        if (N.isNullOrEmpty(str)) {
            return new ArrayList<>();
        }

        return split(str, 0, str.length(), size);
    }
419410
function(str) {
            var f = this.filter;
            return (f) ?  str.replace(new RegExp(f.searchExp, 'g'), f.replaceStr) : str;
        }
556240
function(str) {
      var type, res;

      str = str || '';
      res = str.match(/(uncaught)?\s?(\w+)\:/i);
      type = (res) ? res[2] : null;

      return type;
    }
503840
function str2binb(str)
{
  var bin = [];
  var mask = 255;
  for (var i = 0; i < str.length * 8; i += 8)
  {
    bin[i>>5] |= (str.charCodeAt(i / 8) & mask) << (24 - i%32);
  }
  return bin;
}
547468
function parseSearchString(str) {

    str = tia.cU.replaceXTypesInTeq(str);

    var re = /&(\w|\d|_|-)+/g;

    var searchData = [];
    var prevLastIndex = 0;
    var query;

    while (true) {
      var reResult = re.exec(str);

      if (reResult === null) {
        // Only query string.
        query = str.slice(prevLastIndex).trim();
        if (query) {
          searchData.push({
            query: query,
          });
        }
        return searchData;
      }

      query = str.slice(prevLastIndex, reResult.index).trim();
      var reference = str.slice(reResult.index + 1, re.lastIndex).trim();
      prevLastIndex = re.lastIndex;

      if (query) {
        searchData.push({
          query: query,
        });
      }

      searchData.push({
        reference: reference,
      });

    }
  }
289418
function indexOfWidth(stringWidth, str, width) {
	if (stringWidth === false)
		return width;
	for (var i = 0; i <= str.length; i++) {
		if (getWidth(stringWidth, str.substr(0, i)) > width)
			return i - 1;
	}
	return str.length;
}
237955
function getFile (str) {
  var ret = null
  var match = /[0-9]+,[0-9]+,.*/.test(str)
  if (!match) {
    return null
  }
  var a = str.split(',')
  if (a && a[2]) {
    ret = a[2]
    return ret
  } else {
    return null
  }
  if (isNaN(ret)) {
    return null
  }
  return ret
}
867445
function(str) {
  var abbrRegex = /^\-(\w+?)$/,
      fullRegex = /^\-\-(no\-)?(.+?)(?:=(.+))?$/,
      valRegex = /^[^\-].*/;

  var charMatch = abbrRegex.exec(str),
      chars = charMatch && charMatch[1].split("");

  var fullMatch = fullRegex.exec(str),
      full = fullMatch && fullMatch[2];

  var isValue = str !== undefined && (str === "" || valRegex.test(str));
  var value;
  if (isValue) {
    value = str;
  }
  else if (full) {
    value = fullMatch[1] ? false : fullMatch[3];
  }

  return {
    str: str,
    chars: chars,
    full: full,
    value: value,
    isValue: isValue
  }
}
82350
public static String[] split(String str, String delim, int size) {
        String[] arr1 = new String[size];
        String[] arr2 = split(str, delim);
        for (int i = 0; i < arr1.length; i++) {
            if (i < arr2.length) {
                arr1[i] = arr2[i];
            } else {
                arr1[i] = EMPTY;
            }
        }
        return arr1;
    }
825634
function(str) {
        var p;
        p = str.indexOf('.');
        if (p==-1) {
            return libbcmath.bc_str2num(str, 0);
        } else {
            return libbcmath.bc_str2num(str, (str.length-p));
        }

    }
620329
function(str){
	var retstr = str;

	if( ! us.isUndefined(str) && str.length > 2 ){
	    var end = str.length -1;
	    if( str.charAt(0) == '"' && str.charAt(end) == '"' ){
		retstr = str.substr(1, end -1);
	    }
	}

	return retstr;
    }
1131158
function pad(str, width) {
  var len = Math.max(0, width - str.length);
  return str + Array(len + 1).join(' ');
}