SQL -- String Manipulation in SQL Server
DECLARE @testString VARCHAR(20)
SET @testString = 'Big Bang Theory'
SELECT LEN(@testString) AS _Length,
LEFT(@testString,3) AS _Left,
RIGHT(@testString,6) AS _Right,
SUBSTRING(@testString,5,4) AS _Substring,
REPLACE(@testString,'Bang', 'Bazinga') AS _Replace,
STUFF(@testString,5,0,'Big ') AS _Stuff