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

字符串操作抽取和定位子串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");
ppt 文件大小:4.81MB