FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

jonrandy/metho-string: String prototype extensions · GitHub

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metho String

String prototype extensions using the Metho library:

Usage

import { chunk, pieces, upper, lower, proper, reverse, head, tail } from 'metho-string'

// chunk (if already imported from metho-array, it will also work with strings)
"123456"[chunk(2)] // ["12", "34", "56"]
"12345"[chunk(3)] // ["123", "45"]

// pieces (if already imported from metho-array, it will also work with strings)
// > balanced - attempt to balance the number of items in each piece
"1111111111"[pieces(4)] // ["111", "111", "11", "11"]
// > not balanced
"1111111111"[pieces(4, false)] // ["111", "111", "111", "1"]

// upper
"Hello World"[upper] // "HELLO WORLD"

// lower
"Hello World"[lower] // "hello world"

// proper
"HELLO WORLD"[proper] // "Hello World"

// reverse (if already imported from metho-array, it will also work with strings)
"123"[reverse] // "321"

// head (if already imported from metho-array, it will also work with strings)
"1234"[head] // "1"

// tail (if already imported from metho-array, it will also work with strings)
"1234"[tail] // "234"

About

String prototype extensions

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL