<?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# Development</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:14:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Fateh Chand Rana</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-45967</link>
		<dc:creator>Fateh Chand Rana</dc:creator>
		<pubDate>Thu, 02 Feb 2012 21:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-45967</guid>
		<description>private void button1_Click(object sender, EventArgs e)
        {
            string hh = textBox1.Text;
            string fateh;
            string[] Split = hh.Split(new Char[] { &#039; &#039; });
            //SHOW RESULT
            for (int i = 0; i &lt; Split .Length; i++)
            {
                fateh += Convert.ToString(Split[i]);
            }
            textBox1.Text = fateh;

        }</description>
		<content:encoded><![CDATA[<p>private void button1_Click(object sender, EventArgs e)<br />
        {<br />
            string hh = textBox1.Text;<br />
            string fateh;<br />
            string[] Split = hh.Split(new Char[] { &#8216; &#8216; });<br />
            //SHOW RESULT<br />
            for (int i = 0; i &lt; Split .Length; i++)<br />
            {<br />
                fateh += Convert.ToString(Split[i]);<br />
            }<br />
            textBox1.Text = fateh;</p>
<p>        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Walgreeb</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-17118</link>
		<dc:creator>Alex Walgreeb</dc:creator>
		<pubDate>Wed, 14 Dec 2011 14:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-17118</guid>
		<description>value = Regex.Replace(value, &quot;\\s+&quot;, &quot; &quot;);

Code above will leave only single spaces in between words and remove any whitespace character.</description>
		<content:encoded><![CDATA[<p>value = Regex.Replace(value, &#8220;\\s+&#8221;, &#8221; &#8220;);</p>
<p>Code above will leave only single spaces in between words and remove any whitespace character.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-582</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 23 Jun 2011 03:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-582</guid>
		<description>I have found Regex to be quite slow.  A less pretty but faster solution could look like this:

while (v.IndexOf(&quot;  &quot;) &gt; 0)
        v = formatted_v.Replace(&quot;  &quot;, &quot; &quot;);

leaving only single spaces.  

StringBuilder would be better than String.

Or you could put together a clever little recursive using IndexOf and Remove.</description>
		<content:encoded><![CDATA[<p>I have found Regex to be quite slow.  A less pretty but faster solution could look like this:</p>
<p>while (v.IndexOf(&#8221;  &#8220;) &gt; 0)<br />
        v = formatted_v.Replace(&#8221;  &#8220;, &#8221; &#8220;);</p>
<p>leaving only single spaces.  </p>
<p>StringBuilder would be better than String.</p>
<p>Or you could put together a clever little recursive using IndexOf and Remove.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKiPP</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-581</link>
		<dc:creator>SKiPP</dc:creator>
		<pubDate>Fri, 01 Apr 2011 15:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-581</guid>
		<description>string sourceString = &quot;This is my India.&quot;;
            string stringToReplace = &quot;i&quot;;
            string outputString = sourceString.Replace(stringToReplace.ToLower(), null).Replace(stringToReplace.ToUpper(), null);
            Console.WriteLine(outputString);</description>
		<content:encoded><![CDATA[<p>string sourceString = &#8220;This is my India.&#8221;;<br />
            string stringToReplace = &#8220;i&#8221;;<br />
            string outputString = sourceString.Replace(stringToReplace.ToLower(), null).Replace(stringToReplace.ToUpper(), null);<br />
            Console.WriteLine(outputString);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-580</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 01 Apr 2011 12:33:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-580</guid>
		<description>@HFM Solutions: Use the string.Replace() method, but be sure to pass &quot;i&quot; as a string and not the character &#039;i&#039;:

string s = &quot;This is my India.&quot;;
s = s.Replace( &quot;i&quot;, null );
Console.WriteLine( s );

Output: Ths s my Inda.</description>
		<content:encoded><![CDATA[<p>@HFM Solutions: Use the string.Replace() method, but be sure to pass &#8220;i&#8221; as a string and not the character &#8216;i&#8217;:</p>
<p>string s = &#8220;This is my India.&#8221;;<br />
s = s.Replace( &#8220;i&#8221;, null );<br />
Console.WriteLine( s );</p>
<p>Output: Ths s my Inda.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HFM Solutions</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-579</link>
		<dc:creator>HFM Solutions</dc:creator>
		<pubDate>Fri, 01 Apr 2011 03:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-579</guid>
		<description>Great tutorial.. i have an question that if i have a string &quot;This is my India.&quot; and wants to remove all the &#039;i&#039; character from it and the final string is &quot;Ths s my nda&quot; . How to do this ? 

Thanks in advance ...</description>
		<content:encoded><![CDATA[<p>Great tutorial.. i have an question that if i have a string &#8220;This is my India.&#8221; and wants to remove all the &#8216;i&#8217; character from it and the final string is &#8220;Ths s my nda&#8221; . How to do this ? </p>
<p>Thanks in advance &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bipin</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-578</link>
		<dc:creator>bipin</dc:creator>
		<pubDate>Mon, 31 Jan 2011 11:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-578</guid>
		<description>how do i do ??
 if i want to keep the words seperated with spaces
using Split,Trim.</description>
		<content:encoded><![CDATA[<p>how do i do ??<br />
 if i want to keep the words seperated with spaces<br />
using Split,Trim.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bipin</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-577</link>
		<dc:creator>bipin</dc:creator>
		<pubDate>Mon, 31 Jan 2011 10:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-577</guid>
		<description>Thanks.. very much Adam for e.g of if you want to keep the words seperated with spaces</description>
		<content:encoded><![CDATA[<p>Thanks.. very much Adam for e.g of if you want to keep the words seperated with spaces</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-576</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Tue, 14 Dec 2010 12:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-576</guid>
		<description>@cayber: It&#039;s possible the characters after &quot;abc.wav&quot; are not normal whitespace (maybe they are control characters) in which case the Trim method won&#039;t work, and you would need to manually remove non-alphabetical and non-numeric characters.</description>
		<content:encoded><![CDATA[<p>@cayber: It&#8217;s possible the characters after &#8220;abc.wav&#8221; are not normal whitespace (maybe they are control characters) in which case the Trim method won&#8217;t work, and you would need to manually remove non-alphabetical and non-numeric characters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cayber</title>
		<link>http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-575</link>
		<dc:creator>cayber</dc:creator>
		<pubDate>Tue, 14 Dec 2010 06:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/remove-whitespace-from-c-strings/#comment-575</guid>
		<description>i have a string like abc.wav after wave there is series of empty spaces in it ,i have tried every method to reomeve this ,but failed so far..actually this string come from Socket..n i am recieving this string n trin to remove spaces but still no success ,any help would be appreciated.</description>
		<content:encoded><![CDATA[<p>i have a string like abc.wav after wave there is series of empty spaces in it ,i have tried every method to reomeve this ,but failed so far..actually this string come from Socket..n i am recieving this string n trin to remove spaces but still no success ,any help would be appreciated.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

