NetLogo string extension
An unofficial extension for providing handy string-related primitives in NetLogo.
The following reporters are provided:
explode-- turns a string into a list (of one-character strings)
from-file-- read an entire file into a string with one command
from-list-- turns a list into a string
md5-- generate the MD5 hash for a string
rex-match-- search in strings using standard regular expressions
ends-with?-- match a string against the start or end of another string
trim-- removes initial and trailing whitespace
lower-case-- alter the letter case of strings
If compilation succeeds,
string.jar will be created.
To run the tests in
To build a release package, run
Ideas for possible additional primitives:
ascii-code <character>-- returns the ASCII index of the given character (the first character of the string), or 0 for non-ASCII characters
from-ascii <integer>-- returns the ASCII character corresponding to the given small integer index
last-index-of <needle> <haystack>-- reports the index of the last occurrence of needle in haystack, or false, if needle does not occur
split-on-character <string> <single-char-delimiter>-- reports a list by splitting string using the given single character`
split-on-string <string> <string-delimiter>-- reports a list formed by splitting string using the string-delimiter
position-regex <regex-needle> <haystack>
The string extension was written by James Steiner of turtleZERO.com.
The NetLogo string extension is in the public domain. To the extent possible under law, James Steiner has waived all copyright and related or neighboring rights.