mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
stripLineEnd aka chomp (#9623)
This commit is contained in:
committed by
Andreas Rumpf
parent
62693457df
commit
e4e19f8288
@@ -2513,6 +2513,7 @@ proc stripLineEnd*(s: var string) =
|
||||
## Returns ``s`` stripped from one of these suffixes:
|
||||
## ``\r, \n, \r\n, \f, \v`` (at most once instance).
|
||||
## For example, can be useful in conjunction with ``osproc.execCmdEx``.
|
||||
## aka: `chomp`:idx:
|
||||
runnableExamples:
|
||||
var s = "foo\n\n"
|
||||
s.stripLineEnd
|
||||
|
||||
Reference in New Issue
Block a user