Convert first character of string to uppercase

In this blog we will know how to convert first character of string to uppercase.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
namespace First_character_uppercase
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void btn_upper_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add(firstcharacterupper(textBox1.Text));
            textBox1.Text = "";
        }
        public string firstcharacterupper(string str)
        {
            return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.ToLower());
        }
    }
}

Ebook Download
View all
FileInfo in C#
Read by 9.7k people
Download Now!
Learn
View all