Get the distance of a substring from the start of a line
npm install substr-distance> Get the distance of a substring from the start of a line
 
``bash`
npm install substr-distance
`js
const substrDistance = require('substr-distance');
const page =
Find me!
;substrDistance(page, '
'); // => 4
`API
$3
Find string
needle in haystack, and return the number of characters needle sits from the beginning of the line.- haystack (String): String to search in.
- needle (String): String to search for.
Returns distance from start of line to
needle. If needle is not found at all, -1 is returned.Local Development
`bash
git clone https://github.com/gakimball/substr-distance
cd substr-distance
npm install
npm test
``MIT © Geoff Kimball