![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2008
Posts: 12
Rep Power: 0
![]() |
whitespace remove
If I have a multiline text like..
abcd ef ghi xyz d e f d sjskf s fdf then how would I be able to remove the spaces (/s+) inside the strings (in middle of the strings). I thought using doing like... $string =~ s/\s+/ /g; would work. but it does not work. And if above is the way I would end up finally then can I make it like so it would not alter spaces within <pre> tags like.... #declaring pretags avlyes my $startPreTag="<pre>"; my $endPreTag="</pre>"; #so the spaces (more than one) will be removed is it is not enclosed by pre tags $string =~ s/[^$startPreTag]^\s+[^$endPreTag]//; Please tell me if I am on the right track None of my appraoches are working. Please advise. Thanks! |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jun 2008
Posts: 12
Rep Power: 0
![]() |
Re: whitespace remove
got this working too.
will post the solutions soon. this thread can be closed now. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove minimum search word lengths | Seif | Community Announcements and Feedback | 3 | May 4th, 2007 12:41 AM |
| String Substiution. Whitespace? | MegaArcon | Bash / Shell Scripting | 3 | Jun 28th, 2006 2:47 PM |
| Remove with iterator? | titaniumdecoy | C++ | 6 | Jun 12th, 2006 8:42 AM |
| remove(); | badbasser98 | C++ | 16 | Nov 10th, 2005 2:24 PM |
| Remove line from dat file | SaturN | Python | 9 | Jun 10th, 2005 2:37 PM |