ID:2646684
 
Resolved
replacetext() produced incorrect results when the needle string was blank. Correct behavior is to match in between characters of the haystack string.
BYOND Version:513.1539
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 87.0.4280.101
Applies to:Dream Daemon
Status: Resolved (513.1540)

This issue has been resolved.
Descriptive Problem Summary:
If you use replacetext without a needle, it replaces every character it finds with the replacement, instead of adding the replacement in the nothingness between the characters

Numbered Steps to Reproduce Problem:
1 - use replacetext without a needle
2 - see the result

Code Snippet (if applicable) to Reproduce Problem:
replacetext("aaabbbccc",,"ZZZ",7)


Expected Results:
aaabbbZZZcZZZcZZZc


Actual Results:
aaabbbZZZZZZZZZZZZ


Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur? Never

Workarounds: None

Lummox JR resolved issue with message:
replacetext() produced incorrect results when the needle string was blank. Correct behavior is to match in between characters of the haystack string.