Re: Remove new line char

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Remove new line char
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tcl
Date : 19. Mar 2025, 14:53:23
Autres entêtes
Message-ID : <ygav7s5i0to.fsf@akutech.de>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* alexandru.dadalau@meshparts.de (alexandru)
| I'm accessing the Windows clipboard using twapi.
| When the text in the clipboard was copied from an MS Excel cell, then
| text contains some new line char that I could not identify and thus
| unable to remove it using
>
| regsub {[\r\n]+$} $text ""
>
| What other way are there besides "string trim" to remove new line chars?

First step would be to identify the offending char by printing it in hex
or octal.  Depending on the result, regexp pattern "whitespace" might be
of help

  regsub {[[:space:]]+$} $text ""
  regsub {[\s]+$} $text ""

(cf https://www.tcl-lang.org/man/tcl/TclCmd/re_syntax.htm)

HTH
R'

Date Sujet#  Auteur
19 Mar 25 * Remove new line char23alexandru
19 Mar 25 +* Re: Remove new line char4Ralf Fassel
19 Mar 25 i`* Re: Remove new line char3alexandru
19 Mar 25 i `* Re: Remove new line char2Michael Soyka
20 Mar 25 i  `- Re: Remove new line char1alexandru
19 Mar 25 +- Re: Remove new line char1Arjen
19 Mar 25 +* Re: Remove new line char16Harald Oehlmann
19 Mar 25 i`* Re: Remove new line char15alexandru
19 Mar 25 i +- Re: Remove new line char1alexandru
19 Mar 25 i `* Re: Remove new line char13Rich
20 Mar 25 i  `* Re: Remove new line char12alexandru
20 Mar 25 i   `* Re: Remove new line char11alexandru
20 Mar 25 i    +* Re: Remove new line char9Harald Oehlmann
20 Mar 25 i    i`* Re: Remove new line char8alexandru
20 Mar 25 i    i `* Re: Remove new line char7Rich
21 Mar 25 i    i  `* Re: Remove new line char6Harald Oehlmann
21 Mar 25 i    i   `* Re: Remove new line char5Rich
21 Mar 25 i    i    +* Re: Remove new line char3alexandru
23 Mar 25 i    i    i`* Re: Remove new line char2Harald Oehlmann
24 Mar 25 i    i    i `- Re: Remove new line char1Ashok
23 Mar 25 i    i    `- Re: Remove new line char1Harald Oehlmann
20 Mar 25 i    `- Re: Remove new line char1Michael Soyka
20 Mar 25 `- Re: Remove new line char1Simon Geard

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal