您可以将 .Contains(string) 与 Select Case 语句一起使用吗?
无论如何,我可以构建一个使用 Contains 函数的 Select 语句吗?像这样:
Select commentStr
Case commentStr.Contains("10")
Case commentStr.Contains("15")
Is there anyway I can build a Select statement that uses the Contains function? Like this:
Select commentStr
Case commentStr.Contains("10")
Case commentStr.Contains("15")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,使用此构造,最多将执行一个
Case
。(另请注意,您的 C# 朋友无法使用
switch
执行此操作,这需要case
子句中的常量表达式:))Note that with this construct, a maximum of one
Case
will be executed.(Also note that your C# friends can't do this with
switch
, which requires constant expressions in thecase
clauses :))