java.lang.String.indexOf(char ch) 方法返回字符ch在指定字符串中第一次出现的下标索引位置 如果字符ch在指定的字符串中找不到,则返回-1 示例: import java.lang.*; public class StringDemo { public static void main(String[] args) { String str = "This is tanglc's cnblog"; // returns the index of char…
转: using System; class Program { static void Main() { string[] array = { "cat", "dot", "perls" }; // Use Array.Exists in different ways. bool a = Array.Exists(array, element => element == "perls"); bool b = Array…