Sujet : Re: Remove new line char
De : simon (at) *nospam* whiteowl.co.uk (Simon Geard)
Groupes : comp.lang.tclDate : 20. Mar 2025, 11:07:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrgpd7$3037b$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 19/03/2025 11:47, alexandru wrote:
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?
Many thanks
Alexandru
--
Could this be an encoding issue? I remember that the default output from a Powershell is UTF-16 LE so maybe that's true of Excel (which I don't have so can't test).Another thought is to create a list split on the unwanted newline character then reassemble it.Simon