PDA

View Full Version : How to strip extra tabs in my JS editor?



qwikad.com
12-30-2012, 09:34 PM
Hi!

I need a code that will allow only 5 tabs in a row and all other consecutive tabs after that should be stripped.

This is a sample code from the JS editor:




text = text.replace(/^[ \t]+$/mg,"");



I hope it makes sense. Thank you.

Nile
12-30-2012, 09:45 PM
Something like this should work


text = text.replace(/\t{5}/m, "");

Nile
12-31-2012, 03:34 PM
In an effort to keep things organized, you have the option to set a thread to resolved when an issue is fixed. To make the status of the thread resolved:
1. Go to your first post
2. Edit your first post
3. Click "Go Advanced"
4. In the dropdown next to the title, select "RESOLVED"