ITPub博客

首页 > Linux操作系统 > Linux操作系统 > C# 中截取 某个字符串 从某个字母开始的子字符串

C# 中截取 某个字符串 从某个字母开始的子字符串

原创 Linux操作系统 作者:googlgoracle 时间:2012-10-24 17:08:07 0 删除 编辑

C# 中截取 某个字符串 从某个字母开始的子字符串

static void Main(string[] args)
        {
        
            string str = "485269+3456";
            char c = '+';
            Console.WriteLine(str.Substring(str.IndexOf(c)+1));
            
            Console.WriteLine(str.Substring(0,str.IndexOf(c)));
            Console.ReadLine();
        }

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26221264/viewspace-747125/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-10-19

  • 博文量
    36
  • 访问量
    115349