using System; namespace Example1 { class Program { static void Main(string[] args) { Console.WriteLine(typeof(System.IO.File).Namespace.Equals("System.IO")); } } }
using System; namespace Example2 { class Program { static void Main(string[] args) { Console.WriteLine(typeof(System.Math).Namespace.Equals("System.IO")); } } }This code example demonstrates how to use Namespace Equals to check if the namespace of the System.Math class is equal to the string "System.IO". The output will be "False" because the namespace of the Math class is "System". Package library: System.Runtime.dll