Regex.Replace(StringName.Trim(), @",", @" and ", RegexOptions.IgnoreCase);
Tuesday, 27 March 2018
Monday, 26 March 2018
Split String Scalar Valued Function
CREATE FUNCTION SplitString
(
@Input NVARCHAR(MAX),
@Character CHAR(1)
)
RETURNS @Output TABLE (
Item NVARCHAR(1000)
)
AS
BEGIN
DECLARE @StartIndex INT, @EndIndex INT
SET @StartIndex = 1
IF SUBSTRING(@Input, LEN(@Input) - 1, LEN(@Input)) <> @Character
BEGIN
SET @Input = @Input + @Character
END
WHILE CHARINDEX(@Character, @Input) > 0
BEGIN
SET @EndIndex = CHARINDEX(@Character, @Input)
INSERT INTO @Output(Item)
SELECT SUBSTRING(@Input, @StartIndex, @EndIndex - 1)
SET @Input = SUBSTRING(@Input, @EndIndex + 1, LEN(@Input))
END
RETURN
END
GO
Test ::
Test ::
SELECT Item
FROM dbo.SplitString('Apple,Mango,Banana,Guava', ',')
Subscribe to:
Posts (Atom)
React Hooks - custom Hook
v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...
-
Garbage collection is a low-priority process that serves as an automatic memory manager which manages the allocation and release of memory...
-
private static Regex _compiledUnicodeRegex = new Regex(@"[^\u0000-\u007F]", RegexOptions.Compiled); public static Strin...
-
SELECT name , email , COUNT (*) FROM users GROUP BY name , email HAVING COUNT (*) > 1