如何在C#中实现Array.IndexOf?

问题描述 投票:-1回答:1

我一直在寻找它,但似乎在任何地方都找不到。有谁能够帮助我?我需要使用它,但Mac的Visual Studio中不存在它,所以它会很有帮助。

c# implementation
1个回答
0
投票

你是这个意思吗?

string [] aBunchOfWords = new string[] {
            "hey", "check", "out", "this", "bunch", "of", "words"
        }; 
        int whereMyWordIs = Array.IndexOf(aBunchOfWords, "this"); 
        Console.WriteLine(whereMyWordIs);
© www.soinside.com 2019 - 2024. All rights reserved.