fix this.std missing removeSuffix
This commit is contained in:
parent
eea431a912
commit
e2021b7093
1 changed files with 8 additions and 0 deletions
|
|
@ -22,4 +22,12 @@ in rec {
|
|||
|
||||
hasInfix = infix: content:
|
||||
match ".*${escapeRegex infix}.*" "${content}" != null;
|
||||
|
||||
removeSuffix = suffix: str: let
|
||||
sufLen = stringLength suffix;
|
||||
sLen = stringLength str;
|
||||
in
|
||||
if sufLen <= sLen && suffix == substring (sLen - sufLen) sufLen str
|
||||
then substring 0 (sLen - sufLen) str
|
||||
else str;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue