You can try
for (int i = 65; i < (65 + 26); i++)
{
Console.WriteLine((char)i);
}
That should write out A-Z.
Hope it helps you
---------------------------
Nexus6Studio.net
---------------------------
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson
Sent: Monday, March 17, 2008 10:55 PM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] Write out the alphabet
On Mon, Mar 17, 2008 at 9:48 PM, R. Rogers <[EMAIL PROTECTED]> wrote:
> 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.
>
>
for(int i = (int)'a'; i <= (int)'z'; i++)
Console.Write((char)i)
--
Steve Johnson
===================================
This list is hosted by DevelopMentorR http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com