String left pad.
P.S: I will not publish it to any module platform.
leftpad = require './left-pad'
leftpad 'foo', 5
# => " foo"
leftpad 'foobar', 6
# => "foobar"
leftpad 1, 2, 0
# => "01"
module Main where
import LeftPad
main :: IO ()
main = putStrLn $ leftpad "foo" 6 'f'
-- => ffffoo
(load 'left-pad.scm')
(leftpad "foo" 6 #\f) ; => "ffffoo"
<?php
include_once 'left-pad.php';
echo leftpad("foo", 6, 'f'); // => "ffffoo"
?>