Strings Flashcards

1
Q

What is concatenation?

A

Strings can be joined together to form new strings. That’s concatenation. It’s often done using the ‘+’ operator.

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

What are upper, lower, length and subStrings called and what do they act on?

A

They’re special functions called methods. They act on a particular object and are called using the object’s name followed by a dot and the method’s name.

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

What is x.upper?

A
  • Changes all characters in string x to upper case.

- e.g. HELLO

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

What is x.lower?

A
  • Changes all characters in string x to lower case.

- e.g. hello

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

What is x.length?

A
  • Returns the number of characters in string x.

- e.g. 5

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

What is x[i]?

A
  • Extracts the character in position i from string x

- e.g. x[1] = “e”

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

What is x.subString(a,b)?

A
  • Extracts a string starting at position a with length b from string x.
  • e.g. x.subString(3,2) = “lo”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly