Reply to Re: Replace Multiple Spaces with One Space?

Your name:

Reply:


Posted by MikeJ on 10/18/07 22:43

also instead of calling a function many times
create a function or a proct
Sample incomming string

declare @somestring varchar(100)
set @somestring = 'aaa bbb cccc eee fff f gggg h i aa '
--sample guts of function / proc
while charindex(' ',@somestring)>0 begin
set @Somestring = replace(@somestring,' ',' ')
end
print @somestring
---output aaa bbb cccc eee fff f gggg h i aa




"Blackburn" <blackburn@2centsediting.mypants.com> wrote in message
news:1192727141_459@sp12lax.superfeed.net...
> "Russ Rose" <russrose@hotmail.com> wrote:
>>
>
>
> How did you guys miss the recursion boat?
>
> Create function dbo.udf_CondenseSpaces (@str varchar(8000))
>
> Returns varchar(8000)
> AS
>
> BEGIN
> Declare @s varchar(8000)
>
> Set @s = replace(@str, ' ', ' ')
>
> if charindex(' ', @s) > 0
>
> set @s = dbo.udf_CondenseSpaces(@s)
>
> return @s
> END

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация