Fri 22 Dec 2017 04:04:06 PM UTC, comment #11:
A few coding style issues were there, which have been rectified now.
(file #42703)
|
Thu 21 Dec 2017 01:20:46 PM UTC, comment #10:
Sahil and I have tested this code, and we now think it is ready to be used.
Because octave uses double and single quotes differently than Matlab, we cannot get 100% compatibility, but we think that this code is quite useful as it is. Some one tying to convert from matlab to octave will see a message that will help them make the changes for it to work on octave.
Sahil ask how to contribute to the octave code and I chose this as a starter project for him. I think he has great potential to become a real octave developer. I have a second project for him :-)
Doug
|
Thu 21 Dec 2017 01:05:15 PM UTC, comment #9:
The code has been optimised a bit.
(file #42694)
|
Mon 18 Dec 2017 08:42:35 AM UTC, comment #8:
We have unit-tested the function with the edge tests, if however, someone encounters any problem, suggestions/feedback, kindly let us know. Again, thanks to the contributors for helping me out at every step.
(file #42670)
|
Sun 17 Dec 2017 04:03:24 AM UTC, comment #7:
Yes we are still working on it.
|
Sun 17 Dec 2017 04:00:48 AM UTC, comment #6:
Is there a second version of erase.m coming? That was the suggestion from comment #4.
|
Thu 14 Dec 2017 05:16:39 PM UTC, comment #5:
I am providing here examples from 2017b for the purpose of test units. They mainly cover the logic for trailing whitespace (must be kept) and for overlapping matches.
|
Wed 13 Dec 2017 03:37:27 PM UTC, comment #4:
I have suggested some improvements to Sahil, so an improved version is on its way.
|
Wed 13 Dec 2017 01:15:21 PM UTC, comment #3:
I tried my best not to fail in any of the edge cases but if so happens, kindly let me know. Any other criticisms are welcomed as well. Thanks to 'doug_' and all others for helping me out. Further guidelines as to how can i test on standard unit tests will be appreciated.
|
Tue 12 Dec 2017 04:29:21 PM UTC, comment #2:
There is a beginner who is starting by writing this as a M function. I will see how he makes out.
|
Tue 12 Dec 2017 04:23:30 PM UTC, comment #1:
Confirmed. It often isn't worth it for Octave to follow Matlab too closely because they have a habit of changing their function names, discontinuing functions, altering the API, etc. If the function survives for a few years without change then it can be worth adopting.
In the mean time, you can have the same functionality with regexprep().
|
Tue 12 Dec 2017 01:41:59 PM UTC, original submission:
A new function was introduced in MATLAB R2016b that erases sub-strings within a string.
erase(string,sub-string)
with the return being the remains of the original string.
Full documentation available at:
https://uk.mathworks.com/help/matlab/ref/erase.html
|