<?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>Tue, 07 Sep 2010 15:50:57 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rick B</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5661</link>
		<dc:creator>Rick B</dc:creator>
		<pubDate>Sat, 04 Sep 2010 17:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5661</guid>
		<description>public static class StringExtensions
    {
        public static string StripPunctuation(this string s)
        {
            var sb = new StringBuilder();
            foreach (char c in s)
            {
                if (!char.IsPunctuation(c))
                    sb.Append(c);
            }
            return sb.ToString();
        }

        public static string StripWhiteSpace(this string s)
        {
            var sb = new StringBuilder();
            foreach (char c in s)
            {
                if (!char.IsWhiteSpace(c))
                    sb.Append(c);
            }
            return sb.ToString();
        }
    }</description>
		<content:encoded><![CDATA[<p>public static class StringExtensions<br />
    {<br />
        public static string StripPunctuation(this string s)<br />
        {<br />
            var sb = new StringBuilder();<br />
            foreach (char c in s)<br />
            {<br />
                if (!char.IsPunctuation(c))<br />
                    sb.Append(c);<br />
            }<br />
            return sb.ToString();<br />
        }</p>
<p>        public static string StripWhiteSpace(this string s)<br />
        {<br />
            var sb = new StringBuilder();<br />
            foreach (char c in s)<br />
            {<br />
                if (!char.IsWhiteSpace(c))<br />
                    sb.Append(c);<br />
            }<br />
            return sb.ToString();<br />
        }<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5450</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Mon, 26 Apr 2010 13:44:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5450</guid>
		<description>http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes</description>
		<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes" rel="nofollow">http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5449</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Mon, 26 Apr 2010 13:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5449</guid>
		<description>yes, cause &quot;[ \t\r\n\v\f]&quot; not the only one&#039;s symbols which can be interpreted as whitespace</description>
		<content:encoded><![CDATA[<p>yes, cause "[ \t\r\n\v\f]" not the only one's symbols which can be interpreted as whitespace</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5448</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 26 Apr 2010 13:09:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5448</guid>
		<description>@SKIPP: So you are claiming your 20 lines of code are better than this article&#039;s one line?  Regex works great and is relatively fast.  Also note that your method is wholly inefficient because it scans the source string for every whitespace character, instead of the other way around.</description>
		<content:encoded><![CDATA[<p>@SKIPP: So you are claiming your 20 lines of code are better than this article's one line?  Regex works great and is relatively fast.  Also note that your method is wholly inefficient because it scans the source string for every whitespace character, instead of the other way around.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5447</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Mon, 26 Apr 2010 13:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5447</guid>
		<description>for previous post

one line:
string macString = textBox1.Text.Replace( &quot;:&quot;, &quot;&quot; ).Replace(&quot;-&quot;, &quot;&quot;).Replace(&quot; &quot;, &quot;&quot;);</description>
		<content:encoded><![CDATA[<p>for previous post</p>
<p>one line:<br />
string macString = textBox1.Text.Replace( ":", "" ).Replace("-", "").Replace(" ", "");</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5446</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Mon, 26 Apr 2010 12:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5446</guid>
		<description>cause String.WhitespaceChars may be unavailable

use this array:
string[] whitespaceChars = new string[] {
char.ConvertFromUtf32(9),
char.ConvertFromUtf32(10),
char.ConvertFromUtf32(11),
char.ConvertFromUtf32(12),
char.ConvertFromUtf32(13),
char.ConvertFromUtf32(32),
char.ConvertFromUtf32(133),
char.ConvertFromUtf32(160),
char.ConvertFromUtf32(5760),
char.ConvertFromUtf32(8192),
char.ConvertFromUtf32(8193),
char.ConvertFromUtf32(8194),
char.ConvertFromUtf32(8195),
char.ConvertFromUtf32(8196),
char.ConvertFromUtf32(8197),
char.ConvertFromUtf32(8198),
char.ConvertFromUtf32(8199),
char.ConvertFromUtf32(8200),
char.ConvertFromUtf32(8201),
char.ConvertFromUtf32(8202),
char.ConvertFromUtf32(8203),
char.ConvertFromUtf32(8232),
char.ConvertFromUtf32(8233),
char.ConvertFromUtf32(12288),
char.ConvertFromUtf32(65279)};</description>
		<content:encoded><![CDATA[<p>cause String.WhitespaceChars may be unavailable</p>
<p>use this array:<br />
string[] whitespaceChars = new string[] {<br />
char.ConvertFromUtf32(9),<br />
char.ConvertFromUtf32(10),<br />
char.ConvertFromUtf32(11),<br />
char.ConvertFromUtf32(12),<br />
char.ConvertFromUtf32(13),<br />
char.ConvertFromUtf32(32),<br />
char.ConvertFromUtf32(133),<br />
char.ConvertFromUtf32(160),<br />
char.ConvertFromUtf32(5760),<br />
char.ConvertFromUtf32(8192),<br />
char.ConvertFromUtf32(8193),<br />
char.ConvertFromUtf32(8194),<br />
char.ConvertFromUtf32(8195),<br />
char.ConvertFromUtf32(8196),<br />
char.ConvertFromUtf32(8197),<br />
char.ConvertFromUtf32(8198),<br />
char.ConvertFromUtf32(8199),<br />
char.ConvertFromUtf32(8200),<br />
char.ConvertFromUtf32(8201),<br />
char.ConvertFromUtf32(8202),<br />
char.ConvertFromUtf32(8203),<br />
char.ConvertFromUtf32(8232),<br />
char.ConvertFromUtf32(8233),<br />
char.ConvertFromUtf32(12288),<br />
char.ConvertFromUtf32(65279)};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/comment-page-1/#comment-5444</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Mon, 26 Apr 2010 12:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-5444</guid>
		<description>it is better solution,
if we have string s:
StringBuilder sb = new StringBuilder(s);
foreach (char wc in in string.WhitespaceChars)
  sb.Replace(wc, &#039; &#039;); // replace with space
s = sb.ToString();</description>
		<content:encoded><![CDATA[<p>it is better solution,<br />
if we have string s:<br />
StringBuilder sb = new StringBuilder(s);<br />
foreach (char wc in in string.WhitespaceChars)<br />
  sb.Replace(wc, ' '); // replace with space<br />
s = sb.ToString();</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>
