我在SQL Server中有大字符串.我想将该字符串截断为10或15个字符
原始字符串
this is test string. this is test string. this is test string. this is test string.
Run Code Online (Sandbox Code Playgroud)
期望的字符串
this is test string. this is ......
Run Code Online (Sandbox Code Playgroud) string selectedLeaveTypes = "";
foreach (ListItem item in chkLeaveType.Items)
{
if (item.Selected)
{
selectedLeaveTypes = selectedLeaveTypes + "'" + item.Value + "',";
}
}
selectedLeaveTypes = "(" +selectedLeaveTypes+ ")";
DataRow[] rows = dt.Select("LeaveType IN '" + selectedLeaveTypes + "'");
Run Code Online (Sandbox Code Playgroud)
语法错误:IN 关键字后面的项目必须用逗号分隔并括在括号中。