Check out example codes for "sql server rtrim everything after character". It will help you in understanding the concepts better.

Code Example 1

SELECT   [FullName]
	    ,LEFT([FullName], CHARINDEX(',', [FullName]) - 1) AS [Surname]
	    ,REPLACE(SUBSTRING([FullName], CHARINDEX(',', [FullName]), LEN([FullName])), ',', '') AS [FirstName]
FROM    Employee

Learn ReactJs, React Native from akashmittal.com