Keeping as close to your original code as possible... :

for (int letter = Convert.ToInt32('a'); letter <= Convert.ToInt32('z');
letter++)
        Console.WriteLine("{0} {1}", (char)letter, letter.ToString()); 

HTH,
-Chay Harley
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of R. Rogers
Sent: Tuesday, March 18, 2008 12:49 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] Write out the alphabet

The Char datatype isn't as wieldly as I thought it would be in C#.
How can I write some simple code similar to this:

for (char Letter = 'a'; Letter <= 'z'; Letter++)
  Debug.Write(Letter.ToString());

It's the part of incrementing the char, that I can't figure out.

Any pointers are much appreciated,

Thanks.

Richard Rogers
http://www.RichardRogers.ca/
(MSN) [EMAIL PROTECTED]

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided "as is", 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to