Dear San,
I want to write function so that it accepts string and character and returns modified string.
for example if i send input as function_Name (asp.net,c#,sql Server, "OR")
function must return "asp.net" OR "c#" OR "sql server"
Thanks in advance
Raja TPosted Nov 30, 2015, 9:04 AM
Raja TPosted Nov 30, 2015, 11:39 PM
samantaPosted Nov 30, 2015, 11:37 PM
Raja TPosted Nov 30, 2015, 9:07 AM
samantaPosted Nov 30, 2015, 8:37 AM
Upendra Pratap ShahiPosted Nov 30, 2015, 8:34 AM
CREATE FUNCTION [dbo].[fn_SeperateString]
(@Tvar1 nvarchar(50),
@Tvar2 nvarchar(50),
@Tvar3 nvarchar(50),
@seperator nvarchar(50)
)
RETURNS varchar(200)
AS
BEGIN
declare @Return varchar(200)
select @return ='"'+@Tvar1+'"'+''+@seperator+''+'"'+@Tvar2+'"'+''+@seperator+''+'"'+@Tvar3+'"'
return @return
end
SELECT dbo.[fn_SeperateString]('asp.net','c#','sql Server', 'OR') AS Results
samantaPosted Nov 30, 2015, 8:33 AM
samantaPosted Nov 30, 2015, 8:29 AM
Raja TPosted Nov 30, 2015, 8:26 AM
Upendra Pratap ShahiPosted Nov 30, 2015, 8:26 AM
Gantasala VenkatanarayanamurthPosted Nov 30, 2015, 8:23 AM
Console.WriteLine(s.Replace(",", " or "));
Console.ReadLine();