TextHandling

by Deadron
Various text-related functions you might find useful, including reading files into lists and replacing words in strings.
ID:80493
 
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)
Great library!

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