Convert first character of string to uppercase

Satyapriyanayak
Posted by Satyapriyanayak under C# category on | Points: 40 | Views : 1365
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());
}
}
}

Comments or Responses

Login to post response