我必须拆分一个字符串,我需要取前 25 个字符,然后是其他字符,这是我的代码
select
SUBSTRING(field, 1, 25),
SUBSTRING(field, 26, (LEN(field)-25))
from table
Run Code Online (Sandbox Code Playgroud)
但我得到了第二个子字符串:
传递给左侧或子字符串函数的长度参数无效
这有什么问题吗?
我在反序列化 json 文件时遇到问题,这是 json:
[
{
"id": "id",
"number": "48",
"date": "17-01-2020",
"details": [
{
"id": "id",
"code": "code",
"description": "desc"
},
{
"id": "id",
"code": "code",
"description": "desc"
}
],
"address": "add",
"note": null
},
{
"id": "id",
"number": "55",
"date": "17-01-2020",
"details": [
{
"id": "id",
"code": "code",
"description": "desc"
},
{
"id": "id",
"code": "code",
"description": "desc"
}
],
"address": "add",
"note": null
}
]
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
var result = httpClient.GetAsync(".....").Result;
List<Docu> doc= new JavaScriptSerializer().Deserialize<List<Docu>>(result.Content.ReadAsStringAsync().Result);
Run Code Online (Sandbox Code Playgroud)
类 Docu 包含 …