Does the array contain the specified string element?

更新于
2026-10-10 05:09:00
3阅读来源:SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计99个文字,预计阅读时间需要1分钟。

Does the array contain the specified string element?

csharpusing System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace ConsoleApplication5{ class Program { static void Main(string[] args) { string[] arry={ abcdef, ghijklmn }; string str=abcd; if (arry.Contains(str)) { Console.WriteLine(String found in array.); } else { Console.WriteLine(String not found in array.); } } }}


using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace ConsoleApplication5 { class Program { static void Main(string[] args) { String[] arry =new String[]{"abcdef","ghijklmn"}; String str="abcd"; if (arry.Contains(str)) { Console.WriteLine("A"); } else { Console.WriteLine("B");//B } } } }

Does the array contain the specified string element?

本文共计99个文字,预计阅读时间需要1分钟。

Does the array contain the specified string element?

csharpusing System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace ConsoleApplication5{ class Program { static void Main(string[] args) { string[] arry={ abcdef, ghijklmn }; string str=abcd; if (arry.Contains(str)) { Console.WriteLine(String found in array.); } else { Console.WriteLine(String not found in array.); } } }}


using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace ConsoleApplication5 { class Program { static void Main(string[] args) { String[] arry =new String[]{"abcdef","ghijklmn"}; String str="abcd"; if (arry.Contains(str)) { Console.WriteLine("A"); } else { Console.WriteLine("B");//B } } } }

Does the array contain the specified string element?