C# 子字符串由子字符串更改?
读这本书时,我发现OData过滤器字符串函数C# 子字符串由子字符串更改?,c#,rest,web-services,substring,odata,C#,Rest,Web Services,Substring,Odata,读这本书时,我发现OData过滤器字符串函数bool子字符串(字符串p0,字符串p1) 正在尝试在我的应用程序中使用它: /Categories?$select=CategoryName&$filter=substring(CategoryName,'Seafood') 并得到错误: No function signature for the function with name 'substring' matches the specified arguments. The func
bool子字符串(字符串p0,字符串p1)
正在尝试在我的应用程序中使用它:
/Categories?$select=CategoryName&$filter=substring(CategoryName,'Seafood')
并得到错误:
No function signature for the function with name 'substring' matches the specified arguments. The function signatures considered are:
substring(Edm.String Nullable=true, Edm.Int32);
substring(Edm.String Nullable=true, Edm.Int32 Nullable=true);
substring(Edm.String Nullable=true, Edm.Int32, Edm.Int32);
substring(Edm.String Nullable=true, Edm.Int32 Nullable=true, Edm.Int32);
substring(Edm.String Nullable=true, Edm.Int32, Edm.Int32 Nullable=true);
substring(Edm.String Nullable=true, Edm.Int32 Nullable=true, Edm.Int32 Nullable=true).
看起来所需的子字符串函数不存在了?在哪里
我发现类似的功能很好用:
/Categories?$select=CategoryName&$filter=substringof(CategoryName,'Seafood')
也许是因为这个原因:
substringof()
是一个V3函数,而contains()
是一个V4函数
请立即尝试包含:
$filter=contains(Name,'King')
请参阅子字符串存在,但未在参数中使用两个字符串:
string子字符串(string p0,int pos)
或string子字符串(string p0,int pos,int length)
查看MSDN文档时,substring
从未使用两个string
对象作为参数。你确定这不仅仅是一个打字错误吗?