logo CodeStepByStep logo

Dracula

Language/Type: C# string

What is the value of s after the following code is finished running?

string s = "dracula";
for (int i = 0; i < s.Length; i++) {
    char a = s[0];
    string b = s.Substring(1);
    s = b + a;
}
value of s
(order shuffled)

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.