using System;
public class Program
{
public void Main()
string str = "This is a test String";
//calling the function and passing string as parameter
bool hasspace = this.isThereSpace(str);
if(hasspace)
Console.WriteLine("Yes string contain space");
}
else
Console.WriteLine("NO string doesnt have any space");
//Function to check if string contains space
private bool isThereSpace(String s)
//Check string contains space
if (s.Contains(" "))
//Return true as result
return true;
//Return false as result
return false;