SQL – SQL Server STR() Function
The SQL Server STR() function returns a number as a string.
The SQL Server STUFF() function deletes a part of a string, starting at a specified position, and then inserts a new part into the string at that position.
The SQL Server SUBSTRING() function extracts a specified number of characters from a specified position in a string.
The SQL Server TRANSLATE() function returns the string from the first argument after the characters in the second argument are translated into it.
The SQL Server TRIM() function removes leading and trailing spaces (default) OR other specified characters from the start or end of a string.
The SQL Server UNICODE() function returns an integer value (the Unicode value) for the first character of the input expression.
Python has various built-in data types to allow for variables to store different types of data that can do different things.
In Python, strings are surrounded by either single quotation marks, or double quotation marks. “Hello World” is the same as ‘Hello World’.
A range of characters can be returned from a string by using the slice syntax.
To concatenate, or combine, two strings in Python, the + operator is used.
To insert characters that will cause problems in a string, an escape character (backslash \ followed by the character you want to insert) is used.
To format a string, F-String is used by putting an f in front of the string literal and adding curly brackets {} as placeholders for variables/operations.
The Python string capitalize() method returns a string where the first character is upper case, and the rest is lower case.
The Python string casefold() method returns a string where all the characters are lower case.
The Python string center() method will center align the string, using a specified character (space is default) as the fill character.
The Python string count() method returns the number of times a specified value appears in the string.
The Python string encode() method encodes the string using the specified encoding. If no encoding is specified, UTF-8 will be used.
The Python string endswith() method returns “True” if the string ends with the specified value, and “False” if it does not.