C# 移除制定字符串 string str="12453.12"我想根据str得到 "12453"就是将 "." 之后的字符全部删除首先 "." 两边的字符长度未知 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str="12453.12" ; string[] csdn=str.Split('.'); Console.WriteLine(csdn[0]);//方法太多了! 后面的接着上代码!! int intIndex=str.IndexOf(".");string str2=str.Remove(intIndex);就OK啦。。 string str="12453.12" ; str=str.Split('.')[0]; str = str.Remove(str.IndexOf('.')); Console.WriteLine(str); str = str.Substring(0, str.IndexOf('.'));这么也可以 这样也是可以的: string s = "12453.12"; s=s.Substring(0, s.IndexOf("."));http://www.mybuffet.cn SQL优化一下。。。急。。。有差不多的直接结贴。。。 NND win7 vs2010 死活装不上。。。 GridView1下,如何增加两个删除按钮列实现两个不同的功能? crystalReport不用crystalReportView,能预览吗? 为什么在C#运行的时候看不到建成立的菜单啊? 奇怪的连接超时,谢谢大家帮忙 [求助]请问怎样使进度条与网页下载同步? 简单问题请赐教,解决马上结贴 关于分类显示问题 如何给mdi主窗口加一个网页背景并且不影响子窗口的显示 C# 方法中语法问题 codebehind的问题
Console.WriteLine(csdn[0]);//方法太多了! 后面的接着上代码!!
string str2=str.Remove(intIndex);
就OK啦。。
Console.WriteLine(str);
str = str.Substring(0, str.IndexOf('.'));这么也可以
string s = "12453.12";
s=s.Substring(0, s.IndexOf("."));
http://www.mybuffet.cn