/// <summary> /// 职位的短名称 /// 互联网_开发==》开发 /// </summary> /// <param name="industryPost"></param> /// <returns></returns> public static string ShortName(this IndustryPost industryPost) { // StringBuilder sb = new StringBuilder(); var ss = industryPost.ToString().Split('_'); return(ss[ss.Length - 1]);//返回最后一段 }
/// <summary> /// 职位的'干净'名称 /// 互联网软件_市场营销_营销总监->营销总监 /// </summary> /// <param name="industryPost"></param> /// <returns></returns> public static string PostName(this IndustryPost industryPost) { var name = industryPost.ToString(); int index = name.LastIndexOf('_'); if (index < 0) { return(name); } return(name.Substring(index + 1)); }