Answer the question
In order to leave comments, you need to log in
How to add points to classes?
There is a line:
I tried it like this:
You need it like this:const str = 'class1 class2';
const newstr = str.replace(/^[^\d]/g, .$1);
'.class1 .class2'
Answer the question
In order to leave comments, you need to log in
const newstr = str.split(" ").map(cls => '.${cls}').join(" ");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question