diff --git a/pypdf/generic/_data_structures.py b/pypdf/generic/_data_structures.py index 83f630956..ec32360ae 100644 --- a/pypdf/generic/_data_structures.py +++ b/pypdf/generic/_data_structures.py @@ -172,7 +172,7 @@ def _to_lst(self, lst: Any) -> list[Any]: elif isinstance(lst, PdfObject): result = [lst] elif isinstance(lst, str): - if lst[0] == "/": + if lst.startswith("/"): result = [NameObject(lst)] else: result = [TextStringObject(lst)]