i have a string where there is no space in between and there is a set of characters which keeps on repeating in the same string, but i want to replace those set of characters with \n
. here is what i have tried but i'm not able to see anything
here is the string
lorem%20ipsum%20skdjajsadsa%0D%0Askdjsadkasjdkjasdsjds%0D%0Aadasdkjsadkjsad%0D%0Aaki7yuj%0
in the string there are 3 occurrences of %0D%0A
, i want to replace those with \n
, how can i do this
here is what i have tried.
str = "lorem%20ipsum%20skdjajsadsa%0D%0Askdjsadkasjdkjasdsjds%0D%0Aadasdkjsadkjsad%0D%0Aaki7yuj%0"
console.log(
str.replace("%0D%0A", "\n")
);