字符插入
declare @partnr varchar(100),
@start int,
@len int
select @start=1
select @partnr='abcdefghieeefffgggeeeefedef'
select @partnr=stuff(@partnr,@start,0,',')
select @len=len(@partnr)
--print @len
while @len>0
--and @start<len(@partnr)
begin
select @len=@len-4
select @start=@start+4
select @partnr=stuff(@partnr,@start,0,',')
end
print @partnr
--要三位加上一个','怎么不对?请看看
--结果必须是,abc,def,ghi,eee,fff,ggg,eee,efe,def
@start int,
@len int
select @start=1
select @partnr='abcdefghieeefffgggeeeefedef'
select @partnr=stuff(@partnr,@start,0,',')
select @len=len(@partnr)
--print @len
while @len>0
--and @start<len(@partnr)
begin
select @len=@len-4
select @start=@start+4
select @partnr=stuff(@partnr,@start,0,',')
end
print @partnr
--要三位加上一个','怎么不对?请看看
--结果必须是,abc,def,ghi,eee,fff,ggg,eee,efe,def
...全文
相关推荐
Python 实现字符串中指定位置插入一个字符
下面小编就为大家分享一篇Python 实现字符串中指定位置插入一个字符,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
Python字符串中添加、插入特定字符的方法
主要介绍了Python字符串中添加、插入特定字符的方法,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
java在原字符中插入新字符或字符串实例
主要介绍了java在原字符中插入新字符或字符串实例,具有很好的价值,希望对大家有所帮助。一起跟随小编过来看看吧
用指针实现字符串的插入
用c语言实现用指针的方式将字符串插入到指定的txt文件夹中
java 插入新的字符
java 插入新的字符 java 插入新的字符 java 插入新的字符


疑难问题
