How to Check User Exist in SharePoint User Group

How to check User exist in SharePoint User Group
  1. // Function to check user exist in SharePoint Group  
  2. public bool CheckUserGroup(string groupName, string userName)  
  3.     {  
  4.         bool userFound = false;  
  5.         SPFieldUserValueCollection userCols = new SPFieldUserValueCollection();  
  6.         SPSecurity.RunWithElevatedPrivileges(delegate()  
  7.         {  
  8.             SPSite objSite = new SPSite(SPContext.Current.Web.Url);  
  9.             SPWeb objWeb = objSite.OpenWeb();  
  10.             SPGroup spGroup = objWeb.SiteGroups[groupName];  
  11.             foreach(SPUser groupUser in spGroup.Users)  
  12.             {  
  13.                 if (groupUser.Name == userName)  
  14.                 {  
  15.                     userFound = true;  
  16.                     break;  
  17.                 }  
  18.             }  
  19.         });  
  20.         return userFound;  
  21.     }  
  22.     // Calling function  
  23. bool isUserAdmin = CheckUserGroup("Administrator""Ramakrishna Basagalla");