+ 6

I want to make a space remover code in javascript.

If i add a some text in textarea. Like a How are you? What is this? My name is ashi. What are you doing? My new code. Its sololearn. And after click on submit button its show me all words like this without starting space. How are you? What is this? My name is ashi. What are you doing? My new code. Its sololearn.

29th Nov 2021, 4:13 PM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
12 Respostas
29th Nov 2021, 4:49 PM
Aakaanksha 💕 [TheBraveCoders]
Aakaanksha 💕 [TheBraveCoders] - avatar
+ 7
U can use: SomeString.replace(/ /g, "") to replace all space in a string
29th Nov 2021, 4:32 PM
Aakaanksha 💕 [TheBraveCoders]
Aakaanksha 💕 [TheBraveCoders] - avatar
+ 7
In HTML all the white space are ignored by default. You can use <pre> tag if you want your text as it is.
29th Nov 2021, 4:33 PM
zexu knub
zexu knub - avatar
29th Nov 2021, 4:40 PM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 3
Ayesha Noor You haven't defined your onclick function yet. Submit button is useless without that.
29th Nov 2021, 4:47 PM
zexu knub
zexu knub - avatar
+ 2
Aakaanksha 💕, can be written much simpler: .replace(/^\ +/gm,"")
29th Nov 2021, 6:03 PM
Solo
Solo - avatar
+ 1
Please make a example
29th Nov 2021, 4:41 PM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 1
Akaanksha, can you plzzz make a one exapmle ?
29th Nov 2021, 4:42 PM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 1
Thanks so much.
29th Nov 2021, 5:34 PM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 1
Ephraim Please create a new question, not in a discussion. And to answer your question, HTML is important because it's basically how every website works.
1st Dec 2021, 5:08 AM
Boay.JS
Boay.JS - avatar
- 5
यार मुझको यहाँ कुछ भी समझ नहीं आ रहा है। 😌😌😒😒😣😣😣😭😭😭😭
30th Nov 2021, 12:46 AM
Sarfraj Ahmad
- 5
Nice
30th Nov 2021, 9:25 AM
Saqib Khan
Saqib Khan - avatar