Skip to content

Instantly share code, notes, and snippets.

View wacoom's full-sized avatar
🏠
Working from home

Sazure wacoom

🏠
Working from home
View GitHub Profile
@wacoom
wacoom / extract.js
Created December 14, 2020 04:42 — forked from GuillaumeJasmin/extract.js
Extract substring between two strings
String.prototype.extract = function(prefix, suffix) {
s = this;
var i = s.indexOf(prefix);
if (i >= 0) {
s = s.substring(i + prefix.length);
}
else {
return '';
}
if (suffix) {