Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nameoverflow/left-pads
Do not reinvent the wheel
https://github.com/nameoverflow/left-pads
Last synced: about 1 month ago
JSON representation
Do not reinvent the wheel
- Host: GitHub
- URL: https://github.com/nameoverflow/left-pads
- Owner: nameoverflow
- Created: 2016-03-26T06:58:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-26T07:43:25.000Z (almost 9 years ago)
- Last Synced: 2024-10-16T15:31:02.288Z (3 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 1000 Bytes
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# left-pad
String left pad.
P.S: I will not publish it to any module platform.
## Usage
### CoffeeScript
```coffee-script
leftpad = require './left-pad'leftpad 'foo', 5
# => " foo"leftpad 'foobar', 6
# => "foobar"leftpad 1, 2, 0
# => "01"
```### Haskell
```haskell
module Main where
import LeftPadmain :: IO ()
main = putStrLn $ leftpad "foo" 6 'f'
-- => ffffoo```
### Scheme
```scheme
(load 'left-pad.scm')
(leftpad "foo" 6 #\f) ; => "ffffoo"
```### PHP
```php
"ffffoo"
?>
```