截取字符串

  string Strsubs = "abcde:123456";
            //截取第一个出现/
            //int indexof = Strsubs.IndexOf(":")+1;
            //第一种方式
            //this.textBox3.Text = Strsubs.Substring(indexof, Convert.ToInt32(Strsubs.Length - indexof));
            //第二种方式
            this.textBox3.Text=Strsubs.Split(new string[] { ":"}, StringSplitOptions.None)[1].ToString();

 

posted on 2008-09-24 13:37  freexiaoyu  阅读(219)  评论(0编辑  收藏  举报