运算符"=="不能应用于“方法组"和“字符串"类型的操作数

运算符

问题描述:

我在此代码第三行收到无法将运算符'=='应用于'方法组'和'字符串'类型的操作数"错误,我不知道为什么.

I am receiving an "Operator '==' cannot be applied to operands of type 'method group' and 'string'" error on the third line of this code and I do not know why.

where (PRIORITiesItem.Prioid == null || PRIORITiesItem.Prioid.Contains("1%")) 
    && (SITEItem.Id == "TH" || SITEItem.Id == "NM")  
--> && (sv.Glseg.TrimStart == "703" || sv.Glseg.TrimStart == "704" || sv.Glseg.TrimStart == "705")        
    && (CREWItem.Crewid == null || !CREWItem.Crewid.Contains("2-%") && CREWItem.Crewid.Contains("MAINT") 
        || (CREWItem.Crewid.Contains("ELECT") || CREWItem.Crewid.Contains("INST")
    && !WORKORDERTYPEItem.Id.Contains("Standing")))

起初我以为也许它不喜欢"==",所以我用"="修改了它,但这不是问题.此外,它上方的那一行使用"==",并且工作正常. Glseg是表中的字段,而不是方法,因此它一定不能喜欢字符串.有谁知道我要去哪里错了?

At first I thought that maybe it didn't like "==" so I chnaged it with "=" but that wasn't the problem. besides, the line right above it uses "==" and it works just fine. Glseg is a field within a table, not a method so it must not like the string. Does anyone have any ideas where I am going wrong?

在C#中,必须使用()调用这些方法:

In C#, those methods have to be called with ():

str.TrimStart() == "bla"