- Fixed a bug with the split() proc.
- Changed how the replace proc works to increase its speed by 50%.
- Added the Replace() and split() procs which are case-sensitive versions of replace and split.
- Added the prefix() and ending() procs which determine if one string starts or ends with another string. Prefix() and Ending() are the case-sensitive versions.
- Did some benchmarking to compare performance against the Deadron.TextHandling library. The benchmarking code is included as demo\benchmark.dm
The prefix() and ending() procs are almost identical to the dd_hasprefix and dd_hassuffix procs. Their performance is about the same and because those procs are so simple, it can't make much of a difference. The only difference is because the dd_hassuffix proc is incorrect:
it should be findtext(text, suffix, start + 1), otherwise this will happen:
The value of start will be length("fails") - length("fail"), which is 1. String indexes start at 1, so this is checking if the string "fail" is found in "fails" (and it is). Instead it should start checking at index = 2, so it checks if "fail" is found in "ails" (and it's not). The library even has an automatic built-in test, oops indeed!