logo CodeStepByStep logo

MarshallMathers

Language/Type: VB string

Given the following variable declarations:

' index               0123456789012345678901234
Dim s1 As String   = "Snoop Dogg"
Dim s2 As String   = "Marshall 'Eminem' Mathers"
Dim s3 As String   = s2.Substring(18)
Dim book As String = "Art & Science of VB"

Give the results of the following expressions. Make sure to indicate a value of the proper type (e.g. strings in " " quotes).

s1.Length
s2.Length
s1.IndexOf("o")
s2.IndexOf("x")
s1.Substring(6, 3)
s2.Substring(21)
book.Substring(6, 6)
s3.ToLower()

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.