登录 注册
当前位置:主页 > 资源下载 > 31 > 定位和抽取子串-C#入门经典教程

定位和抽取子串-C#入门经典教程

  • 更新:2024-06-22 15:19:08
  • 大小:4.81MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:.Net - 课程资源
  • 格式:PPT

资源介绍

字符串操作 抽取和定位子串 string poem = “In Xanadu did Kubla Khan”; string poemSeg = poem.Substring(10); poemSeg = poem.Substring(0,9); int index = poem.IndexOf(“I”); index = poem.LastIndexOf(“n”); 比较字符串 bool isMatch; string title = "Ancient Mariner"; isMatch = (title == "ANCIENT AMRINER"); isMatch = (title.ToUpper() == "ANCIENT MARINER"); isMatch = title.Equals("Ancient Mariner");