笨小孩做开发

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

                            string  strID ="NODE_aSDFghsdfgyuhjidfgh_45678" //得到_ 中间的数

                              int index = strID.IndexOf("_");
                            int namelength = strID.Length;
                            string id = strID.Substring(index, strID.Length - index);
                            //id = id.Substring(1, id.Length - 4);
                            string strStar = id.Substring(1);

                            int li_Index = strStar.LastIndexOf("_");
                            string ls_New = strStar.Substring(0, li_Index);//获得目标字符串

posted on 2014-06-14 15:50  笨小孩做开发  阅读(203)  评论(0编辑  收藏  举报