VB.NET谓词数组查找

前端之家收集整理的这篇文章主要介绍了VB.NET谓词数组查找前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使用Array.Find将以下内容转换为VB.NET谓词?
Private Function FindCulture(ByVal Code As String) As Globalization.CultureInfo
    '
    Dim AllCultures As Globalization.CultureInfo() = Globalization.CultureInfo.GetCultures(Globalization.CultureTypes.AllCultures)
    '
    For Each Culture As Globalization.CultureInfo In AllCultures
        If Culture.TwoLetterISOLanguageName = Code Then
            Return Culture
        End If
    Next
    '
    Return Nothing
    '
End Function
Private Function FindCulture(ByVal Code As String) As Globalization.CultureInfo
    Dim AllCultures As Globalization.CultureInfo() = Globalization.CultureInfo.GetCultures(Globalization.CultureTypes.AllCultures)
    Return Array.Find(AllCultures,Function(s) s.TwoLetterISOLanguageName = Code)
End Function
原文链接:https://www.f2er.com/vb/255318.html

猜你在找的VB相关文章