TextHandling |
|
Various text-related functions you might find useful, including reading files into lists and replacing words in strings. [More] |
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Deadron.TextHandling##version=5 Emulator users, in the BYOND pager go to File | Open Location and enter this URL:byond://Deadron.TextHandling##version=5 |
Text-related functions you might find useful. The library contains full documentation and examples. If you are looking to sort text, check out my List library.
dd_file2list(file_path, separator = "\n") dd_replacetext(text, search_string, replacement_string) dd_replaceText(text, search_string, replacement_string) dd_hasprefix(text, prefix) dd_hasPrefix(text, prefix) dd_hassuffix(text, suffix) dd_hasSuffix(text, suffix) dd_text2list(text, separator) dd_text2List(text, separator) dd_list2text(list/the_list, separator) dd_centertext(message, length) dd_limittext(message, length) |
Copyright © 2024 BYOND Software.
All rights reserved.
I came across a low pri usability issue.
If you forget to include the delimiter (ahem) for dd_text2list, the Dream Daemon gets stuck in a loop and you are directed toward a function in Text_Handling. A user friendly change might be to force an exception with information about the missing parameter.
ts