std.array.replaceFirst didn't work with variable length strings

* also added doc unittest

moved import into static ifs