[英语学习]Lesson2.pptVIP

  • 1
  • 0
  • 约8.68千字
  • 约 60页
  • 2018-02-28 发布于浙江
  • 举报
[英语学习]Lesson2

--数据类型、数组和字符串 1、将任意一字符串反序输出,并且每个字符都大写。 2、求将某一字符串str中的所有子序列smod都删除后所得的新串newStr? 例如: str = “H234llo,Wo234rld234!”; smod = “234”; 求新串 newStr ? Thank You! 用IndexOf()方法,查找子串 字符串类型(string) string s9 = Battle of Hastings, 1066; // outputs 10 System.Console.WriteLine(s9.IndexOf(Hastings)); // outputs -1 System.Console.WriteLine(s9.IndexOf(1967)); 用Split()方法分解串中单词 字符串类型(string) char[] delimit = new char[] { }; string s10 = The cat sat on the mat.; string[] words = s10.Split(delimit); foreach (string substr in words) { System.Console.WriteLine(substr); } 输出结果 The cat

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档