✅ Separate local function with explicit 'return' statement
Hello guys, can someone explain why my IDE yells at me to use an "explicit" return statement pls. What is it trying to convey and why should I use it?

C#
string[] words = {"racecar" ,"talented", "deified", "tent", "tenet"};
Console.WriteLine("Is it a palindrome?");
foreach (string word in words)
{
Console.WriteLine($"{word}: {IsPalindrome(word)}");
}
bool IsPalindrome(string word)
{
int startPointerIndex = 0;
int endPointerIndex = word.Length - 1;
for (int i = 0; i < word.Length - 1; i++)
{
if (word[startPointerIndex] == word[endPointerIndex] && startPointerIndex < endPointerIndex)
{
continue;
}
else
{
return false;
}
startPointerIndex++;
endPointerIndex--;
}
return true;
}string[] words = { "racecar", "talented", "deified", "tent", "tenet" };
Console.WriteLine("Is it a palindrome?");
foreach (string word in words)
{
Console.WriteLine($"{word}: {IsPalindrome(word)}");
}
bool IsPalindrome(string word)
{
bool CheckIsPalindrome()
{
for (int left = 0, right = word.Length - 1; left < right; left++, right--)
if (char.ToLower(word[left]) != char.ToLower(word[right]))
return false;
return true;
}
return CheckIsPalindrome();
}string[] words = { "racecar", "talented", "deified", "tent", "tenet" };
Console.WriteLine("Is it a palindrome?");
foreach (string word in words)
{
Console.WriteLine($"{word}: {IsPalindrome(word)}");
}
return;
bool IsPalindrome(string word)
{
return CheckIsPalindrome();
bool CheckIsPalindrome()
{
for (int left = 0, right = word.Length - 1; left < right; left++, right--)
if (char.ToLower(word[left]) != char.ToLower(word[right]))
return false;
return true;
}
}