 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Mar 09, 2006 12:28 am
Perl chomp equivalent? |
In Perl you can do a chomp which will remove the last character of a line if and only if it is a newline character. When I capture channel text to a separate window, the window width is different so I'd like to remove the newline characters to keep it from fragmenting the lines mid-sentence in the other window.
Perhaps I can do a subregex, but would I search for "\n"? |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Mar 09, 2006 3:26 am |
Yes... you can and you would search for '\n'.
Your expression would be something like
Code: |
#TRIGGER { (*) } { #VAR NewString %subregex("%1","(*)\n","%1")} |
Alternatively you could try (which may be more efficient)
Code: |
#TRIGGER { (*) } { #IF (%ends("%1", "\n")) { #VAR NewString %leftback("%1",1)} } |
|
|
_________________ Asati di tempari! |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|