Split a continuous word having camel case:
ALTER function [dbo].[fn_SplitCamelCaseWord](@InputString varchar(200))
returns varchar(200)
begin
declare @i int, @value varchar(255), @returnValue varchar(255), @countCamelCase int
set @i = 0
set @returnValue = ''
SET @countCamelCase=0
while @i < Len(@InputString)
Begin
set @i = @i + 1
if @i>0 AND Ascii(Substring(@InputString,@i,1)) BETWEEN 65 AND 90
Begin
IF @countCamelCase>0
BEGIN
SET @returnValue = @returnValue + ' '
END
SET @countCamelCase=1;
End
IF(@countCamelCase>0)
SET @returnValue = @returnValue + Substring(@InputString, @i, 1)
End
return @returnValue
end
ALTER function [dbo].[fn_SplitCamelCaseWord](@InputString varchar(200))
returns varchar(200)
begin
declare @i int, @value varchar(255), @returnValue varchar(255), @countCamelCase int
set @i = 0
set @returnValue = ''
SET @countCamelCase=0
while @i < Len(@InputString)
Begin
set @i = @i + 1
if @i>0 AND Ascii(Substring(@InputString,@i,1)) BETWEEN 65 AND 90
Begin
IF @countCamelCase>0
BEGIN
SET @returnValue = @returnValue + ' '
END
SET @countCamelCase=1;
End
IF(@countCamelCase>0)
SET @returnValue = @returnValue + Substring(@InputString, @i, 1)
End
return @returnValue
end
No comments:
Post a Comment