https://github.com/powerbliz00/alphabet
a simple program sorts lowercase alphabet to uppercase, printing each letter in one line using c# methods
https://github.com/powerbliz00/alphabet
alphabet-sorting c-sharp string-manipulation string-sorting string-split uppercase-conversion variable-conversion
Last synced: 2 months ago
JSON representation
a simple program sorts lowercase alphabet to uppercase, printing each letter in one line using c# methods
- Host: GitHub
- URL: https://github.com/powerbliz00/alphabet
- Owner: Powerbliz00
- Created: 2024-07-07T15:17:32.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-07T15:22:52.000Z (11 months ago)
- Last Synced: 2025-03-16T06:12:05.520Z (2 months ago)
- Topics: alphabet-sorting, c-sharp, string-manipulation, string-sorting, string-split, uppercase-conversion, variable-conversion
- Language: C#
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Uppercase Alphabet
This simple C# program demonstrates how to convert lowercase letters to uppercase using the `ToUpper()` method.
## Code Explanation
The code iterates through the lowercase alphabet and converts each letter to uppercase using the `ToUpper()` method. It then prints the uppercase letters to the console.
```C#
using System;public class Program
{
// C# Main method - The program start here
static void Main(string[] args)
{
string alphabet = "abcdefghijklmnopqrstuvwxyz";
// Iteration in each letter in the alphabet string
foreach (char letter in alphabet){
// definition of new variable 'letterCapitalCase' for converting char type into string output
string letterCapitalCase = letter.ToString().ToUpper();
// Output method
Console.WriteLine(letterCapitalCase);
}
}
}
```## Running the Program
### Windows
1. **Install .NET SDK:** If you don't have it already, download and install the .NET SDK from [https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download).
2. **Compile the code:** Open a command prompt and navigate to the directory containing the C# file (`Program.cs`). Run the following command to compile the code:
```bash
dotnet build
```
3. **Run the program:** Execute the following command to run the compiled program:
```bash
dotnet run
```### Linux
1. **Install .NET SDK:** Install the .NET SDK using your distribution's package manager. For example, on Ubuntu:
```bash
sudo apt update
sudo apt install dotnet-sdk-6.0
```
2. **Compile the code:** Open a terminal and navigate to the directory containing the C# file (`Program.cs`). Run the following command to compile the code:
```bash
dotnet build
```
3. **Run the program:** Execute the following command to run the compiled program:
```bash
dotnet run
```## Output
The program will output the uppercase alphabet to the console, one letter per line:
```
A
B
C
...
Z
```This repository serves as a basic example of string manipulation in C# and demonstrates the use of the `ToUpper()` method
and the need of `Type conversion from char type from string type, using ToString() method`.