Skip to content

Commit

Permalink
Update startsWith and endsWith invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Aug 15, 2023
1 parent c29df47 commit 8706e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fhirpathpy/engine/invocations/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ def substring(ctx, coll, start, length=None):

def starts_with(ctx, coll, prefix):
string = ensure_string_singleton(coll)
if not string or not isinstance(prefix, str):
return False
return string.startswith(prefix)


def ends_with(ctx, coll, postfix):
string = ensure_string_singleton(coll)
if not string or not isinstance(postfix, str):
return False
return string.endswith(postfix)


Expand Down

0 comments on commit 8706e7c

Please sign in to comment.