I want to replace all forward slashes with a backward slash followed by a forward slash.
Example:
../src/services/resource_mgmt/
Should be converted to
..\/src\/services\/resource_mgmt\/
I don’t know hot use replaceAll(...) with the correct regex.
>Solution :
const url = '../src/services/resource_mgmt/';
const newUrl = url.replaceAll(/\//g, '\\/');
console.log(newUrl);