using System;
class Program
{
// Case-insensitive check without a loop
static bool CharExistsIgnoreCase(string s, char target) {
// Convert both to lowercase and use Contains()
return s.ToLower().Contains(char.ToLower(target));
}
static void Main()
{
// Define the string we want to search in
string s = "CSharpLanguage";
// Perform the case-insensitive check
bool exists = CharExistsIgnoreCase(s, 'c');
// Print the raw boolean result
Console.WriteLine(exists);
// Conditional check
if (exists) {
Console.WriteLine("exists");
}
else {
Console.WriteLine("not exists");
}
}
}
/*
run:
True
exists
*/