Tag: Convert specified BST index dex to specified position character ring capitalization
1. The CHARINDEX function is used to find the starting position of a specified character (string) in another string, returns an integer, returns 0 if not found
Select CHARINDEX (' sql ', ' Microsoft sql SERVER '), returning a result of 11
2. Len returns the length of the string
Select LEN (' Microsoft SQL SERVER '), returning a result of 20
3. Lower function converts uppercase of the given string to lowercase
Select LOWER (' SQL Server Course '), returning the result as "SQL Server Course"
4. The upper function converts the lowercase of the given string to uppercase
Select UPPER (' SQL Server Course '), returning the result as "SQL Server Course"
5, Itrim function to remove the left space of the string
Select LTrim (' SQL Server Course '), returning the result as "SQL Server Course"
6, RTrim function to remove the space to the right of the string
Select RTrim (' SQL Server Course '), returning the result as "SQL Server Course"
7. Left/right function returns the character of the specified bibliography from the left/right of the string
Select Left (' SQL Server Course ', 3), returning the result as "SQL". Select right (' SQL Server Course ', 3) returns the result as "course"
8. Replace function replaces characters in a string
Select REPLACE (' SQL Server Course ', ' Course ', ' test '), return the result as ' SQL Server Test '
9. Substring function splits the given string
Select SUBSTRING (' SQL Server ', 4,11), returning the result as "server"
10. The stuff function deletes a specified length of character from the specified position and inserts a new string at that location
Select STUFF (' SQL Server Course ', 12, 2, ' I removed the course, replaced it with a test ') and returned the result as "SQL Server I removed the course and replaced it with a test"
SQL Series functions--String functions