from typing import List
from typing import Optional


def searchStrInLines(stringToSearch: str, lines: List[str], exactMatch: bool = False) -> Optional[int]:
    """ Return index of a first line where ``stringToSearch`` string can be found.
        Otherwise, return None.

    Args:
        stringToSearch: string to search in lines.
        lines: list of strings, where 'stringToSearch' is searched.
        exactMatch: if True, only exact 'stringToSearch' string is 
            compared in lines. Otherwise, only string presence is checked.
    """
    for lineIndex, line in enumerate(lines):
        if exactMatch:
            if stringToSearch == line:
                return lineIndex
        else:
            if stringToSearch in line:
                return lineIndex

    return None