Skip to content

Instantly share code, notes, and snippets.

View HynesIP's full-sized avatar
💭
I'm in the back.

Randell S. Hynes HynesIP

💭
I'm in the back.
View GitHub Profile
@Paradoxis
Paradoxis / findReplace.js
Created July 4, 2016 10:23
Find and replace double curly braces in JavaScript, example: findReplace("Hello, {{ name }}", "name", "John"); // "Hello, John"
/**
* Format double braced template string
* @param {string} string
* @param {string} find
* @param {string} replace
* @returns {string}
*/
function findReplaceString(string, find, replace)
{
if ((/[a-zA-Z\_]+/g).test(string)) {