Sujet : Re: Remove new line char
De : mssr953 (at) *nospam* gmail.com (Michael Soyka)
Groupes : comp.lang.tclDate : 19. Mar 2025, 21:54:20
Autres entêtes
Organisation : self
Message-ID : <vrfats$1jt1f$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
Hi.
I'm sorry I missed what came before but ...
On 03/19/2025 1:44 PM, alexandru wrote:
Thanks Ralf.
I tried:
format %x [scan [string index $text end] %c]
but it only identifies 0 as last char.
Just to be clear, are you saying that scan returns the integer value zero or does it return 48, the ascii code for zero? If it's the integer zero, that says to me that "text" contains a NUL-terminated string. If so, does not
regsub {\x00$} $text {} text_sans_nul
do what you want?
both
set text [regsub {[[:space:]]+$} $text ""]
and
set text [regsub {[\s]+$} $text ""]
made no difference...
--
-mike