字符串转换问题 string str1="Hello_i";string str2=str1.substring(str1.indexof("_")+1);str1=str1.substring(0,str1.indexof("_"))+str2.toupper(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string s = "Hello_IIIkai"; int index = s.IndexOf("_"); if (index > -1) { string temp = s.Substring(index + 1); s = s.Remove(index, s.Length - index); s = s + temp.ToUpper(); } string strlist="Hello_i";string[] strs=strlist.split('_');string str=strs[0].tostring()+strs[1].tostring().ToUpper(); string s = "Hello_IIIkai"; int index = s.IndexOf("_"); string t = s.Substring(0, index) + s.Substring(index + 1).ToUpper(); 那如果有两个下划线 比如 heelo_ied_tr怎么变成heelo_Ied_Tr try thisprivate void button1_Click(object sender, EventArgs e){ /* 字符串的转换函数 例如: Hello_i 变成 HelloI 要求遇到下划线去掉 且下划线后面如果是小写变成大写需要 */ string yourStr = "Hello_i"; string destStr = Regex.Replace(yourStr, "_[a-zA-Z]", MyMatchEvaluator); MessageBox.Show(destStr);}public string MyMatchEvaluator(Match match){ return match.Value.Substring(1).ToUpper();} 正则匹配小问题 请教: 请问在asp.net 2.0中怎么实现GridView中的更新,用代码编写! 求助,关于财务凭证控件 C#中怎样将13(Int型)转换为"L000013"(string型),用哪个类的哪个函数??? 提个问题,分不多,进来看看吧。 怎样把RichTextBox1.Text 以word文件形式保存下来??请教各位大哥大姐! 关于外部函数的指针问题 在网上看到一个很有趣的问题。特来向各位大哥请教。 求教几个关于用C#开发c/s程序的基础问题 TreeView 小问题 刚从c那块看到的一个连接,谁帮忙看看
string s = "Hello_IIIkai";
int index = s.IndexOf("_");
if (index > -1)
{ string temp = s.Substring(index + 1); s = s.Remove(index, s.Length - index);
s = s + temp.ToUpper();
}
string strlist="Hello_i";
string[] strs=strlist.split('_');
string str=strs[0].tostring()+strs[1].tostring().ToUpper();
int index = s.IndexOf("_"); string t = s.Substring(0, index) + s.Substring(index + 1).ToUpper();
{
/*
字符串的转换函数
例如: Hello_i 变成 HelloI
要求遇到下划线去掉 且下划线后面如果是小写变成大写需要
*/
string yourStr = "Hello_i";
string destStr = Regex.Replace(yourStr, "_[a-zA-Z]", MyMatchEvaluator);
MessageBox.Show(destStr);
}public string MyMatchEvaluator(Match match)
{
return match.Value.Substring(1).ToUpper();
}