strings Flashcards
(10 cards)
1
Q
What is the output of “Unity, Peace and Development”.Substring(17,7)?
A
“Develop”
2
Q
What does “Peace and Development”.Contains(“and Dev”) return?
A
true
3
Q
What does “Peace and Development”.LastIndexOf(“a”) return?
A
6
4
Q
Method to remove spaces from string ends?
A
.Trim()
5
Q
String comparison method?
A
Equals() or CompareTo()
6
Q
How to extract a substring?
A
Substring(startIndex, length)
7
Q
Combine username and password with a comma
A
username + “,” + password
8
Q
What are some string properties?
A
Length, Chars[]
9
Q
How to split “A,B,C” into array?
A
“A,B,C”.Split(‘,’)
10
Q
How to convert string “10” to int?
A
Convert.ToInt32(“10”)