I am struggling to remove white spaces, any body help me

var dt1="11 : 30 : am";

I want the result var dt1="11:30:am";

Recommended Answers

All 4 Replies

Don't you ask this question every day?

I can find it in 10 seconds with Google, it doesn't need a discussion!

Before i asked php code, but know asked in javascript.

sorry, i wont ask small questions.. here after

Regards,
Ramu M

dt1.match(/\S+/g).join('');
_> "11:30:am"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.