mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
Updated the code example in the os module to use better grammar. (#12328)
(cherry picked from commit 0d94ee15c0)
This commit is contained in:
@@ -15,19 +15,20 @@
|
||||
## import os
|
||||
##
|
||||
## let myFile = "/path/to/my/file.nim"
|
||||
##
|
||||
## let splittedPath = splitPath(myFile)
|
||||
## assert splittedPath.head == "/path/to/my"
|
||||
## assert splittedPath.tail == "file.nim"
|
||||
##
|
||||
##
|
||||
## let pathSplit = splitPath(myFile)
|
||||
## assert pathSplit.head == "/path/to/my"
|
||||
## assert pathSplit.tail == "file.nim"
|
||||
##
|
||||
## assert parentDir(myFile) == "/path/to/my"
|
||||
##
|
||||
## let splittedFile = splitFile(myFile)
|
||||
## assert splittedFile.dir == "/path/to/my"
|
||||
## assert splittedFile.name == "file"
|
||||
## assert splittedFile.ext == ".nim"
|
||||
##
|
||||
##
|
||||
## let fileSplit = splitFile(myFile)
|
||||
## assert fileSplit.dir == "/path/to/my"
|
||||
## assert fileSplit.name == "file"
|
||||
## assert fileSplit.ext == ".nim"
|
||||
##
|
||||
## assert myFile.changeFileExt("c") == "/path/to/my/file.c"
|
||||
|
||||
##
|
||||
##
|
||||
## **See also:**
|
||||
|
||||
Reference in New Issue
Block a user