Skip to content

Instantly share code, notes, and snippets.

@nufaylr
Last active December 21, 2015 22:29
Show Gist options
  • Save nufaylr/6375768 to your computer and use it in GitHub Desktop.
Save nufaylr/6375768 to your computer and use it in GitHub Desktop.
JS utilities
function removeHash(value)
{
if(value != undefined)
{
if(value.indexOf('#') != -1)
{
value = value.split('#');
value = value[1];
return value;
}
}
}
function removeTags(string)
{
if(string != undefined)
{
string = string.replace(/<div>/gi, "");
string = string.replace(/<\/div>/gi, "");
string = string.replace(/<b>/gi, "");
string = string.replace(/<\/b>/gi, "");
return string;
}
}
function removeMultipleHash(value)
{
if(value != undefined)
{
value = value.replace(/;#/gi, ",");
return value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment