Repository navigation
string
Out of the gate, Niv comes with some basic string manipulation commands.
usage example:
// template
stolist val
// specific use
print "{}\n" (stolist "hello mother")Args:
-
val:STRorCHAR
Desc:
Takes a STR/CHAR val and converts it into a list of CHARs.
Return value: LIST.
For more complex examples check str.nst
usage example:
// template
ltostr lst
// specific use
print "{}\n" (ltostr (stolist "hello mother"))Args:
-
lst:LISTofCHARs
Desc:
Takes the LIST value contained inside lst and converts it into a string.
Return value: STR.
For more complex examples check str.nst
usage example:
// template
lines val
// specific use
print "{}\n" (lines "hello \n there")Args:
-
val:STR
Desc:
Splits a given STR val by newline characters and returns it as a LIST of STRs.
Return value: LIST.
For more complex examples check str.nst
usage example:
// template
words val
// specific use
print "{}\n" (words "hello \"th ere\"")Args:
-
val:STR
Desc:
Splits a given STR val by whitespace characters (but also preserving text in quotes) and returns it as a LIST of STRs.
Return value: LIST.
For more complex examples check str.nst
usage example:
// template
s_words val
// specific use
print "{}\n" (s_words "hello (fj fd) \"th ere\"")Args:
-
val:STR
Desc:
Same as words but also preserves text inside brackets.
Return value: LIST.
For more complex examples check str.nst
usage example:
// template
trim val
// specific use
print "{}\n" (dbg (trim "\thello there \n "))Args:
-
val:STR
Desc:
Trims whitespace characters off the start and end of a STR conatined inside val, and returns the trimmed STR.
Return value: STR.
For more complex examples check str.nst