Deleting spaces

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
gcotterl
Posts: 252
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Deleting spaces

Post by gcotterl »

How can I remove all spaces between the last character and the end of the line?
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Find what: _*$ [replace the underscore with a space]
Replace with: [nothing]
gcotterl
Posts: 252
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Post by gcotterl »

That worked. Thank you.

(I clicked Configure/Preferences/Document Classes/Default and ticked the "Strip trailing spaces from lines when saving" box. I then saved the file and re-opened the file but the trailing spaces were still thee).
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Try closing the file, then opening it again, or try
View | Document Properties | Preferences | Strip trailing spaces from lines when saving.

A good general rule is never to use * when + will do. Using + avoids matching nothing, and in a case like this avoids repeatedly replacing nothing with nothing. It can make a huge difference to the speed of the operation.
Post Reply