C# Programming - Strings - Discussion
Discussion Forum : Strings - General Questions (Q.No. 7)
7.
What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
string str= "Hello World!";
Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() );
}
}
}
Discussion:
14 comments Page 2 of 2.
Jay said:
1 decade ago
In this type ,we write
string.compare and use GetType() method then we find----System.Int32
string.Equals and use GetType() method then we find---System.Boolean
string.Join and use GetType() method then we find----System.System
Always remember
string.compare and use GetType() method then we find----System.Int32
string.Equals and use GetType() method then we find---System.Boolean
string.Join and use GetType() method then we find----System.System
Always remember
Harshil said:
1 decade ago
I think surekha is right.
Surekha said:
1 decade ago
I think it is because String.Compare () returns 0 or 1 which are nothing but of type int32.
Juhi said:
1 decade ago
Can anyone explain me this.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers