String Functions Flashcards

1
Q

ASCII

A

Returns the ASCII code for the first character of string.

Example:

ASCII(‘A’) = 65

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CHAR

A

Returns the character encoded by the ASCII code number.

Example:
CHAR(65) = ‘A’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CONTAINS

A

Returns true if the given string contains the specified substring.

Example:

CONTAINS(“Calculation”, “alcu”) = true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ENDSWITH

A

Returns true if the given string ends with the specified substring. Trailing white spaces are ignored.

Example:

ENDSWITH(“Tableau”, “leau”) = true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

FIND

A

Returns the index position of substring in string, or 0 if the substring isn’t found. If the optional argument start is added, the function ignores any instances of substring that appear before the index position start. The first character in the string is position 1.

Examples:

FIND("Calculation", "alcu") = 2
FIND("Calculation", "Computer") = 0
FIND("Calculation", "a", 3) = 7
FIND("Calculation", "a", 2) = 2
FIND("Calculation", "a", 8) = 0
FIND("Calculation", "a", 3) = 7
FIND("Calculation", "a", 2) = 2
FIND("Calculation", "a", 8) = 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

FINDNTH

A

Returns the position of the nth occurrence of substring within the specified string, where n is defined by the occurrence argument.

Note: FINDNTH is not available for all data sources.

Example:

FINDNTH(“Calculation”, “a”, 2) = 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

LEFT

A

Returns the left-most number of characters in the string.

Example:

LEFT(“Matador”, 4) = “Mata”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

LEN

A

Returns the length of the string.

Example:

LEN(“Matador”) = 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

LOWER

A

Returns string, with all characters lowercase.

Example:

LOWER(“ProductVersion”) = “productversion”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

LTRIM

A

Returns the string with any leading spaces removed.

Example:

LTRIM(“ Matador “) = “Matador “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

MAX

A

Returns the maximum of a and b (which must be of the same type). This function is usually used to compare numbers, but also works on strings. With strings, MAX finds the value that is highest in the sort sequence defined by the database for that column. It returns Null if either argument is Null.

Example:

MAX (“Apple”,”Banana”) = “Banana”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

MID

A

Returns the string starting at index position start. The first character in the string is position 1. If the optional argument length is added, the returned string includes only that number of characters.

Examples:

MID(“Calculation”, 2) = “alculation”
MID(“Calculation”, 2, 5) =”alcul”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

MIN

A

Returns the minimum of a and b (which must be of the same type). This function is usually used to compare numbers, but also works on strings. With strings, MIN finds the value that is lowest in the sort sequence. It returns Null if either argument is Null.

Example:

MIN (“Apple”,”Banana”) = “Apple”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

REPLACE

A

Searches string for substring and replaces it with replacement. If substring is not found, the string is not changed.

Example:

REPLACE(“Version8.5”, “8.5”, “9.0”) = “Version9.0”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

RIGHT

A

Returns the right-most number of characters in string.

Example:

RIGHT(“Calculation”, 4) = “tion”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

RTRIM

A

Returns string with any trailing spaces removed.

Example:

RTRIM(“ Calculation “) = “ Calculation”

17
Q

SPACE

A

Returns a string that is composed of the specified number of repeated spaces.

Example:

SPACE(1) = “ “

18
Q

SPLIT

A

Returns a substring from a string, using a delimiter character to divide the string into a sequence of tokens.

The string is interpreted as an alternating sequence of delimiters and tokens. So for the string abc-defgh-i-jkl, where the delimiter character is ‘-‘, the tokens are abc, defgh, i, and jlk. Think of these as tokens 1 through 4. SPLIT returns the token corresponding to the token number. When the token number is positive, tokens are counted starting from the left end of the string; when the token number is negative, tokens are counted starting from the right.

Examples:

SPLIT (‘a-b-c-d’, ‘-‘, 2) = ‘b’
SPLIT (‘a|b|c|d’, ‘|‘, -2) = ‘c’

19
Q

STARTSWITH

A

Returns true if string starts with substring. Leading white spaces are ignored.

Example:

STARTSWITH(“Joker”, “Jo”) = true

20
Q

TRIM

A

Returns the string with leading and trailing spaces removed.

Example:

TRIM(“ Calculation “) = “Calculation”

21
Q

UPPER

A

Returns string, with all characters uppercase.

Example:

UPPER(“Calculation”) = “CALCULATION”