WorksheetsStrings
Total questions: 8
Worksheet time: 5mins
Which method to use to find length of a string?
length()
size()
long()
count()
Which is correct method to convert String into uppercase
changeUpperCase()
convertUpperCase()
toUpper()
toUpperCase()
String x = "10"
String y = "20"
String z = x + y
Console.Writeline(z)
Guess the output.
1020
10 20
30
"10 20"
What will be the output of below code?
String statement = "Outfit of the day";
Console.Writeline(statement.Substring(3))
f
fit of the day
t
tfit of the day
What is the correct relation between length and last index of the string?
last-index is always 1 more than the length
last-index is 1 less than the length (but not always)
last-index is always 1 less than the length
last-index is always equal to the length
What is word.length()?
String x = "quarantine";
What is the value of x.indexOf("a"); ?
4
3
2
5
String s = "whatever"
What is the value of s.substring(1,3)?
"hate"
"hat"
"whate"
"what"
