VB .Net 等效于产量中断; [英] VB .Net equivalent for yield break;

查看:38
本文介绍了VB .Net 等效于产量中断;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.Net 是否与 c# 的 yield break 等效?

Does VB.Net have an equivealent for c#'s yield break?

Public Function Validate(validationContext As ValidationContext) 
                As IEnumerable(Of ValidationResult) 
                Implements IValidatableObject.Validate
    '' what is equivalent to C#'s - yield break;
End Function

推荐答案

Yield 存在于 vb.net 中,您可以在 msdn

Yield exists in vb.net, as you can see in msdn

您甚至可以找到有关产量中断的信息:

And you'll even find information on yield break :

您可以使用 Exit Function 或 Return 语句 (Visual Basic) 或yield break 语句 (C#) 结束迭代.

You can use an Exit Function or Return statement (Visual Basic) or yield break statement (C#) to end the iteration.

这篇关于VB .Net 等效于产量中断;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆