strings Flashcards

(10 cards)

1
Q

What is the output of “Unity, Peace and Development”.Substring(17,7)?

A

“Develop”

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

What does “Peace and Development”.Contains(“and Dev”) return?

A

true

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

What does “Peace and Development”.LastIndexOf(“a”) return?

A

6

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

Method to remove spaces from string ends?

A

.Trim()

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

String comparison method?

A

Equals() or CompareTo()

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

How to extract a substring?

A

Substring(startIndex, length)

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

Combine username and password with a comma

A

username + “,” + password

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

What are some string properties?

A

Length, Chars[]

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

How to split “A,B,C” into array?

A

“A,B,C”.Split(‘,’)

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

How to convert string “10” to int?

A

Convert.ToInt32(“10”)

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