as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a function that checks whether the given string is a palindrome or not.
user
def check_palindrome(string): 
  # remove all non-alphanumeric characters 
  string = string.lower().replace("[^a-za-z0-9]", "") 

  # check whether the string is empty or not 
  if string == '': 
    return false

  # reverse the given string and check if it is equal to the original string 
  return string == string[::-1]
assistant