<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Remove Whitespace from C# Strings</title>
	<atom:link href="http://www.csharp411.com/remove-whitespace-from-c-strings/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/remove-whitespace-from-c-strings/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Fri, 12 Mar 2010 18:49:35 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeff O'Reilly</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5335</link>
		<dc:creator>Jeff O'Reilly</dc:creator>
		<pubDate>Thu, 03 Dec 2009 23:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5335</guid>
		<description>Thanks so much. I&#039;ve been trying to clean MAC addresses so that it doesn&#039;t matter if you hand it &quot;0011223344&quot;, or &quot;00:11:22:33:44&quot;, or &quot;00 11 22 33 44&quot;.
My button_click code...
string macString = textBox1.Text.Replace( &quot;:&quot;, &quot;&quot; );
macString = macString.Replace(&quot;-&quot;, &quot;&quot;);
macString = macString.Replace(&quot; &quot;, &quot;&quot;);
WakeFunction(macString);</description>
		<content:encoded><![CDATA[<p>Thanks so much. I've been trying to clean MAC addresses so that it doesn't matter if you hand it "0011223344&#8243;, or "00:11:22:33:44&#8243;, or "00 11 22 33 44&#8243;.<br />
My button_click code&#8230;<br />
string macString = textBox1.Text.Replace( ":", "" );<br />
macString = macString.Replace("-", "");<br />
macString = macString.Replace(" ", "");<br />
WakeFunction(macString);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxx the Axe</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5332</link>
		<dc:creator>Maxx the Axe</dc:creator>
		<pubDate>Wed, 02 Dec 2009 06:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5332</guid>
		<description>I think a better approach is to use the Split function and throw away the blank tokens. Then you can re-concatenate the tokens with or without a single space in between (as in, normal sentence spacing).</description>
		<content:encoded><![CDATA[<p>I think a better approach is to use the Split function and throw away the blank tokens. Then you can re-concatenate the tokens with or without a single space in between (as in, normal sentence spacing).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5292</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Tue, 29 Sep 2009 07:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5292</guid>
		<description>Thanks very much.

I want something like this:
If below is my string
ROBERT EATS MEAT.

Write a C# Code to Extract the first Letter, and add it to the last word. e.g i want to return
RMEAT.

How do i do that?

thanks in advance</description>
		<content:encoded><![CDATA[<p>Thanks very much.</p>
<p>I want something like this:<br />
If below is my string<br />
ROBERT EATS MEAT.</p>
<p>Write a C# Code to Extract the first Letter, and add it to the last word. e.g i want to return<br />
RMEAT.</p>
<p>How do i do that?</p>
<p>thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajit</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5286</link>
		<dc:creator>Ajit</dc:creator>
		<pubDate>Thu, 24 Sep 2009 09:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5286</guid>
		<description>Hi,

How to detect two white space in text altogether so that we can remove it in C#</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>How to detect two white space in text altogether so that we can remove it in C#</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adriana</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5282</link>
		<dc:creator>adriana</dc:creator>
		<pubDate>Sun, 20 Sep 2009 21:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5282</guid>
		<description>It worked for me too. Thank you very much - I couldn&#039;t understand this.</description>
		<content:encoded><![CDATA[<p>It worked for me too. Thank you very much &#8211; I couldn't understand this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jyoti</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5083</link>
		<dc:creator>Jyoti</dc:creator>
		<pubDate>Mon, 08 Jun 2009 06:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5083</guid>
		<description>Thanks...It helped</description>
		<content:encoded><![CDATA[<p>Thanks&#8230;It helped</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-3650</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 27 Oct 2008 14:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-3650</guid>
		<description>Cheers Adam. That was helpful :)</description>
		<content:encoded><![CDATA[<p>Cheers Adam. That was helpful <img src='http://www.csharp411.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-3607</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Tue, 14 Oct 2008 21:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-3607</guid>
		<description>This is a nice and simple example
you could use 

string trim = Regex.Replace(text, @&quot;\s+&quot;, &quot; &quot;).Trim();

if you want to keep the words seperated with spaces
e.g.
for this example we will get :

My test string is quite long</description>
		<content:encoded><![CDATA[<p>This is a nice and simple example<br />
you could use </p>
<p>string trim = Regex.Replace(text, @"\s+", " ").Trim();</p>
<p>if you want to keep the words seperated with spaces<br />
e.g.<br />
for this example we will get :</p>
<p>My test string is quite long</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-2770</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 22 Aug 2008 19:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-2770</guid>
		<description>&quot;How is that unfortunate? a string with no whitespace at the beginning or end is FAR FAR more useful than a string with all whitespace removed.&quot;

Well, that depends on the application, doesn&#039;t it?  

It&#039;s unfortunate because it would&#039;ve been nice for the Trim method to handle all cases.  e.g.,

[Flags]
public enum TrimOptions
{
    Start = 0x01,
    Middle = 0x02,
    End = 0x04,
}</description>
		<content:encoded><![CDATA[<p>"How is that unfortunate? a string with no whitespace at the beginning or end is FAR FAR more useful than a string with all whitespace removed."</p>
<p>Well, that depends on the application, doesn't it?  </p>
<p>It's unfortunate because it would've been nice for the Trim method to handle all cases.  e.g.,</p>
<p>[Flags]<br />
public enum TrimOptions<br />
{<br />
    Start = 0&#215;01,<br />
    Middle = 0&#215;02,<br />
    End = 0&#215;04,<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wtf</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-2769</link>
		<dc:creator>wtf</dc:creator>
		<pubDate>Fri, 22 Aug 2008 18:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-2769</guid>
		<description>&quot;Unfortunately, the Trim method does not remove whitespace from the middle of a string.&quot;

How is that unfortunate?  a string with no whitespace at the beginning or end is FAR FAR more useful than a string with all whitespace removed.</description>
		<content:encoded><![CDATA[<p>"Unfortunately, the Trim method does not remove whitespace from the middle of a string."</p>
<p>How is that unfortunate?  a string with no whitespace at the beginning or end is FAR FAR more useful than a string with all whitespace removed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
