Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
string c = “hello”;
string c1 = c.Remove(1);
Console.WriteLine(c1);
Console.ReadLine();
}

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
string c = “hello”;
string c1 = c.Remove(1);
Console.WriteLine(c1);
Console.ReadLine();
}
a) ello
b) h
c) hell
d) none of the mentioned

Answer: b
Explanation: The remove() deletes characters from the string except the character which is specified with its given position.
Output :
h

Join The Discussion