(JS) Javascript Function Remove Slash From String
All I needed was to expel every single forward slice in a string utilizing Javascript. Remove Forward Slash (/) Using JavaScript Function function FSlash(func){ var x = func, n = x.replace(/\//g,''); return n } //Usage Using Variable var nx = "4x/4/4/5/6/7//532///45/"; //Call Variable Into Function Name document.write(FSlash(nx)); //You can combine from function too Demo : CodePen The vital part to note here is the consistent articulation /\//g . The bit of the string you need supplanting is composed between the first and last forward cuts – so on the off chance that you needed the word 'work area' supplanted you would compose/work area/g. As the character we need to expel is an uncommon case you need to escape it utilizing an oblique punctuation line, generally the code will read the twofold forward cut as a remark thus quit preparing the line. At last, the g implies apply the substitution internationally to the s...