检查包含子字符串列表的字符串 [英] Check a string for containing a list of substrings

查看:172
本文介绍了检查包含子字符串列表的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查特定字符串,看看它是否包含一系列子字符串?
具体如下:

How can I check a specific string to see if it contains a series of substrings? Specifically something like this:

public GetByValue(string testString) {

    // if testString contains these substrings I want to throw back that string was invalid
    // string cannot contain "the " or any part of the words "College" or "University"

   ...
}


推荐答案

限制我的数据返回,而是限制我的返回一个.Take(15),如果返回计数超过65,536,只返回null

Decided against checking for strings to limit my data return, instead limited my return to a .Take(15) and if the return count is more than 65,536, just return null

这篇关于检查包含子字符串列表的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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