var str = this.patcher.name + " " + this.patcher.filepath;
2. Replace is a function which produces a result. It does not change the value of str. In order to update str with the new value, you need to assign it:
thanks so much for this. very very helpful to a newcomer.
Although I found a problem.
The space is replaced between the patcher name and file path, although spaces within the file path are still there.
So if patcher name is "foo" and file path is "User/Max 6 Projects/"
I get: "foo!User/Max 6 Projects/"
rather than "foo!User/Max!6!Projects/"
Do the modifications you made only change the first space in the string?