Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 子字符串由子字符串更改?_C#_Rest_Web Services_Substring_Odata - Fatal编程技术网

C# 子字符串由子字符串更改?

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

读这本书时,我发现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 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
对象作为参数。你确定这不仅仅是一个打字错误吗?