Pads the given String to the left with the given character to ensure that
it's at least totalChars long.
430359
public static String padLeft(String str, int totalChars, char ch) {
    if (str == null) {
      str = "null";
    }
    StringBuilder sb = new StringBuilder();
    for (int i = 0, num = totalChars - str.length(); i < num; i++) {
      sb.append(ch);
    }
    sb.append(str);
    return sb.toString();
  }
75959
def pad(string, width, options={})
      supported = [:left, :right, :center]
      padder = options[:padder] || ' '
      align  = options[:align] || :left

      chars = string.to_s.chars.to_a
      if chars.length < width
        string = case :"#{align}"
        when :left
          string + (padder * (width - chars.length))
        when :right
          (padder * (width - chars.length)) + string
        when :center
          right = ((pad_length = width - chars.length).to_f / 2).ceil
          left = pad_length - right
          (padder * left) + string + (padder * right)
        else
          raise ArgumentError, "Alignment must be one of: #{supported.join(' ')}"
        end
      end
      string
    end
488055
private final int skipPadding(String text, int position) {
        while (position < text.length() && text.charAt(position) == pad) {
            ++position;
        }
        return position;
    }
561089
def pad_char(text: str, width: int, char: str = '\n') -> str:
    """"""
    dis = width - len(text)
    if dis < 0:
        raise ValueError
    if dis > 0:
        text += char * dis
    return text
869645
function(str, len, padChar) {
    str = stringIt(str);
    if (str.length >= len) {
      return str;
    }
    var padStr = getPadding(padChar, len);
    return str + padStr.substr(str.length - len);
  }
1254512
public StrBuilder appendPadding(final int length, final char padChar) {
        if (length >= 0) {
            ensureCapacity(size + length);
            for (int i = 0; i < length; i++) {
                buffer[size++] = padChar;
            }
        }
        return this;
    }
76110
def left(ctx, text, num_chars):
    
    num_chars = conversions.to_integer(num_chars, ctx)
    if num_chars < 0:
        raise ValueError("Number of chars can't be negative")
    return conversions.to_string(text, ctx)[0:num_chars]
1047930
public static String leftTrim(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.LEFT_TRIM.apply(input.toString());
   }
72647
def set_stop_chars_left(self, stop_chars):
        
        if not isinstance(stop_chars, set):
            raise TypeError("stop_chars should be type set "
                            "but {} was given".format(type(stop_chars)))

        self._stop_chars_left = stop_chars
        self._stop_chars = self._stop_chars_left | self._stop_chars_right
796695
@Nonnull
    private static String leftpad(@Nonnull String s, int n, char padChar) {
        int diff = n - s.length();
        if (diff <= 0) {
            return s;
        }
        StringBuilder buf = new StringBuilder(n);

        for (int i = 0; i < diff; ++i) {
            buf.append(padChar);
        }
        buf.append(s);
        return buf.toString();
    }
90705
def unicode_left(s, width):
    """"""
    i = 0
    j = 0
    for ch in s:
        j += __unicode_width_mapping[east_asian_width(ch)]
        if width < j:
            break
        i += 1
    return s[:i]
378395
private Character getPadCharacter(String characterString) {
        if (characterString.length() > 0) {
            getLogger().debug("The given character string is longer than one element. The first character is used.");
        }
        return characterString.charAt(0);
    }
860984
public static String leftStr(String str, int length) {
		return str.substring(0, Math.min(str.length(), length));
	}
1125782
public static String left(EvaluationContext ctx, Object text, Object numChars) {
        int _numChars = Conversions.toInteger(numChars, ctx);
        if (_numChars < 0) {
            throw new RuntimeException("Number of chars can't be negative");
        }

        return StringUtils.left(Conversions.toString(text, ctx), _numChars);
    }
650900
def long2str(l):
    """"""
    if type(l) not in (types.IntType, types.LongType):
        raise ValueError('the input must be an integer')

    if l < 0:
        raise ValueError('the input must be greater than 0')
    s = ''
    while l:
        s = s + chr(l & 255)
        l >>= 8

    return s
351429
def _pad(string, size):
    
    strlen = len(string)
    if strlen == size:
        return string
    if strlen < size:
        return _padding[0:size-strlen] + string
    return string[-size:]
134830
function (expr, length, fillChar) {
  fillChar = fillChar || ' ';
  var string = '' + expr;
  if (string.length > length) {
    return left(string, length);
  } else {
    while (string.length < length) {
      string = fillChar + string;
    }
  }
  return string;
}