Purchase Solution

C# Programming and String Variable

Not what you're looking for?

Ask Custom Question

Hi, I need some help with a c# study guide and have a question:

Assuming the string variable myvar contains the string literal "C# Programming", what will be written to the console for the following statements:
(a) Console.Write(myvar.IndexOf("Prog'',3);
(b) Console.Write(myvar.LastIndexOfAny('d');
(c) Console.Write(myvar.CompareTo("myvar");
(d) Console.Write(myvar.Substring(3,5);

Purchase this Solution

Solution Summary

This brief solution discusses C# string manipulation and lists what would be written to the console for the statements.

Solution Preview

(a) 3 will be written to the console since the string literal has "Prog" starting at index of 3.
(b) -1 will ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.