丶将字母全部转换为大写或小写
2011-10-18 20:32
441 查看
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;
namespace Example35
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
this.Text = "将字母全部转换为大写或小写";
}
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
textBox2.Text = textBox1.Text.ToUpper(); //转换为 大写
}
if (radioButton2.Checked)
{
textBox2.Text = textBox1.Text.ToLower(); //转换为 小写
}
}
}
}
//字符串是 不可变 对象 每当对字符串进行操作时 都将产生一个新的字符串对象 尽量避免频繁操作字符串对象 因为频繁操作会在托管堆中产生大量的无用字符串 增加垃圾收集器的压力 从而造成系统资源的浪费!
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Example35
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
this.Text = "将字母全部转换为大写或小写";
}
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
textBox2.Text = textBox1.Text.ToUpper(); //转换为 大写
}
if (radioButton2.Checked)
{
textBox2.Text = textBox1.Text.ToLower(); //转换为 小写
}
}
}
}
//字符串是 不可变 对象 每当对字符串进行操作时 都将产生一个新的字符串对象 尽量避免频繁操作字符串对象 因为频繁操作会在托管堆中产生大量的无用字符串 增加垃圾收集器的压力 从而造成系统资源的浪费!
相关文章推荐
- [AHK]将选中字符中的字母全部转换成【大写 / 小写 / 首字母大写】
- c语言从键盘中输入一串字符串,将字符中的大写转化成小写字母,将小写字母转换成大写字母,以*号键结束
- android Editext限制输入数字和字母以及将小写自动转换成大写的方法
- swift 字母大小写转换代码,大写转小写,小写转大写都是一行
- JavaScript 将字符串第一个字母转换成大写其余的均为小写
- C++中字母大写和小写转换实现的优化
- python title() upper() lower() 以首字母大写的方式显示每个单词/将字符串改为全部大写或全部小写
- hdu3079 Vowel Counting (strlwr(将字符串中的字母转换为小写);strupr(转换为大写))
- 4.从键盘输入一个大写英文字母,将其转换为小写字母后,将转换后的小写英文字母及其十进制的ASCII码显示到屏幕上。
- 从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存。
- VB 录入字母大写自动转换成小写及小写自动转换成大写
- hdu3079 Vowel Counting (strlwr(将字符串中的字母转换为小写);strupr(转换为大写))
- 在Linux下如何将文本文件中的大写字母全部转换为小写字母
- php将字符串全部转换成大写或者小写的方法
- python小练习之将字符串转换成第一个字母大写后面字母小写的形式
- 将字符串中的小写字符全部转换为大写
- 第三章第二十八题将小写字母转换成大写,其他字符不变
- 小写字母转换为大写
- myeclipse把选中的字母转换成大写或者大写转小写
- Android 资源文件名转换,将文件名全部大写转小写的小工具