from typing import Generator
import re


def split_lines(string: str) -> Generator[str, None, None]:
    """
    Splits string into lines, skipping empty; surrounding spaces are removed.
    """
    return (
        x.group(0).strip()
        for x in re.finditer(r".*(?:$|\n)", string)
        if len(x.group(0).strip()) > 0
    )