Re: Perl string manipulation

From: Roy Johnson (rjohnson_at_shell.com)
Date: 10/22/03


Date: 22 Oct 2003 10:36:17 -0700

This newsgroup is defunct. Use comp.lang.perl.misc instead.

jared_zubke@und.nodak.edu (jared in ecs) wrote in message news:<9858258e.0310212215.7a2303d5@posting.google.com>...
> I need to get rid of the spaces from the contents of a varible.

tr/ //d;

(This will leave tabs, newlines, and carriage returns alone, only removing spaces.)



Relevant Pages

  • Trim user input of spaces, tabs, and others
    ... It gets rid of leading/trailing spaces, tabs, newlines and whatever other ...
    (microsoft.public.dotnet.security)
  • Trim user input of spaces, tabs, and others
    ... It gets rid of leading/trailing spaces, tabs, newlines and whatever other ...
    (microsoft.public.dotnet.general)
  • Re: Problem round-tripping with xml.dom.minidom pretty-printer
    ... an XML identical to the original DOM tree: it adds newlines and tabs. ... When parsed again these blank characters are inserted in the DOM tree as ...
    (comp.lang.python)
  • Re: K&R2 ex 1-8
    ... >> newlines. ... >> This compiles, links and behaves on my windows platform except for the ... and it's best to use more blanks (after commas and around ... and my output is 0 enters 2 tabs 1 space. ...
    (comp.lang.c)
  • Re: multiline strings and proper indentation/alignment
    ... Gary John Salerno wrote: ... yourself to indent the second lines so that it lines up where you want it, without causing the newlines and tabs or spaces to be added to the string as well? ... but I don't want the extra newline or tabs to be a part of the string when it's printed. ...
    (comp.lang.python)