码迷,mamicode.com
首页 > 编程语言 > 详细

java和c#中String

时间:2018-09-18 11:02:39      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:键值   sha   nbsp   rem   builder   span   去除   color   添加   

java中:

 

 

c#中:

 

1.拼接字符串 sql语句中 in()

str="‘001‘,‘002‘,‘003‘";
至于产生string就这样  
str1="‘001‘";
str2="‘002‘";
str3="‘003‘";
str=str1+","+str2+","+str3

StringBuilder idlist = new StringBuilder();
for (int i = 0; i < length; i++)
{
    idlist.Append("‘");//添加引号
     idlist.Append( 主键值);// 添加主键
     idlist.Append("‘,");//添加引号和逗号
}
idlist = idlist.Remove(idlist.Length - 1, 1);//去除最后一个逗号

  

 

java和c#中String

标签:键值   sha   nbsp   rem   builder   span   去除   color   添加   

原文地址:https://www.cnblogs.com/ynhk/p/9667175.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!