Get Last Sub String - MSSQL

Get Last Sub String - MSSQL

code snippet

mssql
CREATE FUNCTION [dbo].[GetLastSubString]
(
	@String NVARCHAR(20),
	@delimiter NVARCHAR(1)
)
RETURNS NVARCHAR(200)

AS

BEGIN

DECLARE @LastString as NVARCHAR(20)

SELECT @LastString = RIGHT(@String, CHARINDEX(@delimiter, REVERSE(@String)) - 1)


RETURN @LastString

END

"The secret of getting ahead is getting started"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.