mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
builtin(str): add withPrefix
Closes #4142 Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
parent
f0786121fb
commit
d6526fa425
3 changed files with 30 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ interface Str
|
|||
appendScalar,
|
||||
walkScalars,
|
||||
walkScalarsUntil,
|
||||
withPrefix,
|
||||
]
|
||||
imports [
|
||||
Bool.{ Bool },
|
||||
|
|
@ -561,3 +562,7 @@ strToNumHelp = \string ->
|
|||
Ok result.aresult
|
||||
else
|
||||
Err InvalidNumStr
|
||||
|
||||
## Adds the specified prefix to the string, like a reversed Str.concat
|
||||
withPrefix : Str, Str -> Str
|
||||
withPrefix = \str, prefix -> Str.concat prefix str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue