substrings
Looks for substrings found between two given delimiting strings. Find all results and return an array or find the first result and return it.
Last updated a year ago by davidbwaters .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install substrings 
SYNC missed versions from official npm registry.

substrings.js

Looks for substrings found between two given delimiting strings. Find all results and return an array or find the first result and return it. The delimiters can be the same.

Docs

getAll - looks for all substrings and returns the results in an array.

getOne - looks for the first substring returns the result as a string.

Example

const substrings = require("substrings")

const text = "some text BEFORE substring1 AFTER " +
"some text BEFORE substring2 AFTER some text"

substrings.getAll("BEFORE ", " AFTER", text)
// ["substring1","substring2"]

substrings.getOne("BEFORE ", " AFTER", text)
// "substring1"

Current Tags

  • 1.1.1                                ...           latest (a year ago)

4 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |