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 ...
-
JSON {"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName...
-
Ø The useEffect Hook allows you to perform side effect i n your components. Ø Side effects include fetching data, directly updating th...
-
The steps are explained below with screenshots. 1. We need to have a modal container in the main layout page. All the dialogs will be lo...