> For the complete documentation index, see [llms.txt](https://mass-street-data-school.gitbook.io/deng100-workbook-example/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mass-street-data-school.gitbook.io/deng100-workbook-example/unit-2-introduction-to-sql-fundamentals/sql-language-basics/sample-code/string-functions.md).

# String Functions

```sql
USE AdventureWorksDW2019MSDS

SELECT
FirstName,
MiddleName,
LastName,
CONCAT(FirstName,MiddleName,LastName) AS SmooshedTogether
FROM dw.DimEmployee
WHERE 1 = 1
AND IsMostRecentRecord = 1

SELECT 
EnglishDescription,
LEN(EnglishDescription) AS CountOfCharactersInDescription
FROM dw.DimProduct
WHERE 1 = 1
AND EnglishDescription IS NOT NULL
AND IsMostRecentRecord = 1

SELECT 
EnglishDescription,
LEFT(EnglishDescription,20) AS Left20Chars
FROM dw.DimProduct
WHERE 1 = 1
AND EnglishDescription IS NOT NULL
AND IsMostRecentRecord = 1

SELECT 
EnglishDescription,
RIGHT(EnglishDescription,20) AS Right20Chars
FROM dw.DimProduct
WHERE 1 = 1
AND EnglishDescription IS NOT NULL
AND IsMostRecentRecord = 1

SELECT 
EnglishProductName,
REPLACE(EnglishProductName,'Road', 'Street') AS NameChanged
FROM dw.DimProduct
WHERE 1 = 1
AND ProductSubcategoryCK = 14
AND IsMostRecentRecord = 1


SELECT 
EnglishDescription,
SUBSTRING(EnglishDescription, 10, 15) AS RandomSubstringSelection
FROM dw.DimProduct
WHERE 1 = 1
AND EnglishDescription IS NOT NULL
AND IsMostRecentRecord = 1
```
