29
edits
Line 14: | Line 14: | ||
== subvec() == | == subvec() == | ||
Extract items of a vector (equivalent to the left() function for a string) | |||
Example : | |||
<syntaxhighlight lang="nasal" enclose="div"> | |||
var currentPath = "/home/xxx/yyy/"; | |||
print (directory(currentPath)); | |||
</syntaxhighlight> | |||
returns : ".", "..", "file1", "file2", "file3" | |||
and : | |||
<syntaxhighlight lang="nasal" enclose="div"> | |||
var currentPath = "/home/xxx/yyy/"; | |||
print (subvec(directory(currentPath),2)); | |||
</syntaxhighlight> | |||
returns : "file1", "file2", "file3" | |||
<syntaxhighlight lang="nasal" enclose="div"> | |||
var currentPath = "/home/xxx/yyy/"; | |||
print (subvec(directory(currentPath),3)); | |||
</syntaxhighlight> | |||
returns : "file2", "file3" | |||
== delete() == | == delete() == |
edits