Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!newsgrouper.org!.POSTED!not-for-mail From: Arjen Newsgroups: comp.lang.tcl Subject: Re: Remove new line char References: <99c3a67de883d847a088f8158aea9998@www.novabbs.com> Date: Wed, 19 Mar 2025 15:20:09 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <1742397609-153@newsgrouper.org> Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user153 Injection-Date: Wed, 19 Mar 2025 15:20:09 GMT User-Agent: Newsgrouper/0.7.1 Bytes: 1500 Lines: 22 alexandru.dadalau@meshparts.de (alexandru) posted: > 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 > > -- These applications may insert all manner of invisible characters. Yesterday, a colleague copied some source code from a PowerPoint presentation and that turned out to be riddled with invisible characters that in an editor showed up as "Â". So it goes, to quote Kurt Vonnegut.