+ 1

How can I convert my String in JS

Hey coders, I'm trying to add "+" sign instead of " " in any string Example: This is my text Output: This+is+my+text How can I do that in JS

10th Nov 2023, 8:55 AM
Adarsh Addee
Adarsh Addee - avatar
5 Answers
+ 8
I understood your problem.For this purpose you can use replace method to replace space to `+`. https://code.sololearn.com/WhyNs3erjae1/?ref=app
10th Nov 2023, 9:15 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
+ 2
"This is my text".split(" ").join("+")
10th Nov 2023, 3:28 PM
A͢J
A͢J - avatar
+ 1
Are you saying about parsedatatype() which help we can convert any variable in there datatype ?
10th Nov 2023, 5:12 PM
Pandit dubey rama
Pandit dubey rama - avatar
0
I want to learn
10th Nov 2023, 10:56 PM
Esa Esa
Esa Esa - avatar
0
Solution of A͢J is valid too
12th Nov 2023, 1:24 AM
Yessid Acosta
Yessid Acosta - avatar