NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
``` string stra = "abcdefghijk"; string strtempa = "c"; string strtempb = "j"; //我们要求c---g之间的字符串,也就是:defghi //求得strtempa 和 strtempb 出现的位置: int IndexofA = stra.IndexOf(strtempa); int IndexofB = stra.IndexOf(strtempb); string Ru = stra.Substring(IndexofA + 1, IndexofB - IndexofA -1); Console.WriteLine("Ru = " + Ru); //----这就是你要的结果 Console.ReadLine(); ```