Trim user input of spaces, tabs, and others

From: Shabam (blislecp_at_hotmail.com)
Date: 10/09/04


Date: Sat, 9 Oct 2004 12:32:43 -0700

Is there a function in dotnet that allows me to trim user input so that:

1) It gets rid of leading/trailing spaces, tabs, newlines and whatever other
non-printing characters
2) Gets rid of all tabs, newlines, and whatever other non-printing
characters anywhere else, preferably replacing them with one space
3) Takes any consecutive number of spaces and replace it with just one
space.



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)
  • Re: Perl string manipulation
    ... This newsgroup is defunct. ... > I need to get rid of the spaces from the contents of a varible. ... (This will leave tabs, newlines, and carriage returns alone, only removing spaces.) ...
    (comp.lang.perl)
  • 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)