Skip to main content

ensure_sep

Ensure text s ends in separator sep'.

def ensure_sep(
sep: string,
s: string,
n: integer = 2
) - > string

Ensure text s ends in separator sep'.

Parameters

NameTypeDescription
sepstringThe specific separator character or string to be appended
sstringThe input text string to be processed
ninteger = 2The target total number of separators that should exist at the end of the string

Returns

TypeDescription
stringThe original string appended with the necessary number of separators to reach the target count