system.nim documentation: setLen can handle nil now
This commit is contained in:
parent
ee7515e376
commit
1eaeb8945b
1 changed files with 2 additions and 4 deletions
|
|
@ -1280,15 +1280,13 @@ proc setLen*[T](s: var seq[T], newlen: Natural) {.
|
||||||
## sets the length of `s` to `newlen`.
|
## sets the length of `s` to `newlen`.
|
||||||
## ``T`` may be any sequence type.
|
## ``T`` may be any sequence type.
|
||||||
## If the current length is greater than the new length,
|
## If the current length is greater than the new length,
|
||||||
## ``s`` will be truncated. `s` cannot be nil! To initialize a sequence with
|
## ``s`` will be truncated.
|
||||||
## a size, use ``newSeq`` instead.
|
|
||||||
|
|
||||||
proc setLen*(s: var string, newlen: Natural) {.
|
proc setLen*(s: var string, newlen: Natural) {.
|
||||||
magic: "SetLengthStr", noSideEffect.}
|
magic: "SetLengthStr", noSideEffect.}
|
||||||
## sets the length of `s` to `newlen`.
|
## sets the length of `s` to `newlen`.
|
||||||
## If the current length is greater than the new length,
|
## If the current length is greater than the new length,
|
||||||
## ``s`` will be truncated. `s` cannot be nil! To initialize a string with
|
## ``s`` will be truncated.
|
||||||
## a size, use ``newString`` instead.
|
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## var myS = "Nim is great!!"
|
## var myS = "Nim is great!!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue