```python
def check_Equality(s):
    """
    Counts all substrings of a string that start and end with the same character.
    """
    # A dictionary to store the frequency of each character
    char_counts = {}
    for char in s:
        char_counts[char] = char_counts.get(char, 0) + 1
    
    # Initialize the total count of such substrings
    total_count = 0
    
    # For each character, calculate the number of substrings
    # that can be formed by it.
    # If a character 'c' appears k times, it can form k*(k+1)/2
    # substrings that start and end with 'c'. This is because we can
    # choose any two of its occurrences (including choosing the same one twice)
    # to be the start and end points of a substring.
    for count in char_counts.values():
        total_count += count * (count + 1) // 2
        
    return total_count
```