 




<?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: Convert first letter to uppercase</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 00:45:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: 12345678905850053</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/#comment-99215</link>
		<dc:creator>12345678905850053</dc:creator>
		<pubDate>Sat, 19 Nov 2011 12:53:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-99215</guid>
		<description><![CDATA[if (string.Compare(input.Substring(i,1),input.Substring(i,1).ToUpper()) == 0)
whats the meaning of this code]]></description>
		<content:encoded><![CDATA[<p>if (string.Compare(input.Substring(i,1),input.Substring(i,1).ToUpper()) == 0)<br />
whats the meaning of this code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: twlp123</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/#comment-58039</link>
		<dc:creator>twlp123</dc:creator>
		<pubDate>Tue, 25 Nov 2008 04:39:30 +0000</pubDate>
		<guid isPermaLink="false">#comment-58039</guid>
		<description><![CDATA[it tried method2 and it works..thanks a lot

twlp123]]></description>
		<content:encoded><![CDATA[<p>it tried method2 and it works..thanks a lot</p>
<p>twlp123</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bobbeechey</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/#comment-57993</link>
		<dc:creator>bobbeechey</dc:creator>
		<pubDate>Sat, 22 Nov 2008 22:07:31 +0000</pubDate>
		<guid isPermaLink="false">#comment-57993</guid>
		<description><![CDATA[Let us expand my earlier ideas, so that the first letter will always be capitalised and the rest be forced to lowercase.
Method 1 - use VB.NET which offers
&lt;pre&gt;MyNewString = StrConv(MyString, vbProperCase)
&lt;/pre&gt;

Method 2 - convert to  character array to freely manipulate each letter. This has the advantage of over-riding the caps lock but only capitalises the first letter of the first word.

Method 3 - use a TextInfo object which has a ToTitleCase method. This has thye advantage of capitalising thye first letter of each separate word but is over-ridden by caps lock. (This method requires using System.Globalization and System.Threading.

Here is the code for methods 2 and 3
&lt;pre&gt;private void textBox1_TextChanged(object sender, EventArgs e)
        {
            char[] c = textBox1.Text.ToCharArray();
            int j;
            for (j = 0;j&lt;textBox1.Text.Length;j++) {
                if (j==0) c[j]=c[j].ToString().ToUpper()[0];
                else c[j] = c[j].ToString().ToLower()[0];
            }
            textBox1.Text = new string(c);
            textBox1.Select(textBox1.Text.Length,1);
            }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            CultureInfo cI = Thread.CurrentThread.CurrentCulture;
            TextInfo textInfo = cI.TextInfo;
            textBox2.Text = textInfo.ToTitleCase(textBox2.Text);
            textBox2.Select(textBox2.Text.Length, 1);
        }&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Let us expand my earlier ideas, so that the first letter will always be capitalised and the rest be forced to lowercase.<br />
Method 1 &#8211; use VB.NET which offers</p>
<pre>MyNewString = StrConv(MyString, vbProperCase)
</pre>
<p>Method 2 &#8211; convert to  character array to freely manipulate each letter. This has the advantage of over-riding the caps lock but only capitalises the first letter of the first word.</p>
<p>Method 3 &#8211; use a TextInfo object which has a ToTitleCase method. This has thye advantage of capitalising thye first letter of each separate word but is over-ridden by caps lock. (This method requires using System.Globalization and System.Threading.</p>
<p>Here is the code for methods 2 and 3</p>
<pre>private void textBox1_TextChanged(object sender, EventArgs e)
        {
            char[] c = textBox1.Text.ToCharArray();
            int j;
            for (j = 0;j&lt;textBox1.Text.Length;j++) {
                if (j==0) c[j]=c[j].ToString().ToUpper()[0];
                else c[j] = c[j].ToString().ToLower()[0];
            }
            textBox1.Text = new string(c);
            textBox1.Select(textBox1.Text.Length,1);
            }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            CultureInfo cI = Thread.CurrentThread.CurrentCulture;
            TextInfo textInfo = cI.TextInfo;
            textBox2.Text = textInfo.ToTitleCase(textBox2.Text);
            textBox2.Select(textBox2.Text.Length, 1);
        }</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: bobbeechey</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/#comment-57985</link>
		<dc:creator>bobbeechey</dc:creator>
		<pubDate>Sat, 22 Nov 2008 11:05:56 +0000</pubDate>
		<guid isPermaLink="false">#comment-57985</guid>
		<description><![CDATA[Here is one w
&lt;pre&gt;        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if ((textBox1.Text.Length) == 1)
            {
                textBox1.Text = textBox1.Text[0].ToString().ToUpper();
                textBox1.Select(2, 1);
               
            }
        }
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Here is one w</p>
<pre>        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if ((textBox1.Text.Length) == 1)
            {
                textBox1.Text = textBox1.Text[0].ToString().ToUpper();
                textBox1.Select(2, 1);
               
            }
        }
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: twlp123</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-first-letter-to-uppercase/#comment-57955</link>
		<dc:creator>twlp123</dc:creator>
		<pubDate>Fri, 21 Nov 2008 02:08:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-57955</guid>
		<description><![CDATA[thanks but your answer does not resoleve my question. Delphi function does it perfectly for starting words in a sentence, and the user just keep typing without having to resort to Shift key combination.  The user should see the capitalised starting letter as they continue to type]]></description>
		<content:encoded><![CDATA[<p>thanks but your answer does not resoleve my question. Delphi function does it perfectly for starting words in a sentence, and the user just keep typing without having to resort to Shift key combination.  The user should see the capitalised starting letter as they continue to type</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.032 seconds using memcached
Object Caching 323/329 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-19 01:31:15 -->