for myStr in s.Data:
var myNums: string = myStr
mynums =
myNums.replace("one", "o1ne").replace("two", "t2wo").replace("three", "t3hree").replace(
"four", "f4our"
).replace("five", "f5ive").replace("six", "s6ix").replace("seven", "s7even").replace(
"eight", "e8ight"
).replace("nine", "n9ine").replace("zero", "z0ero").strip(chars = myLower)
To my mind this raises a number of issues
Line lengths should be adjusted to the nearest . prior to the end of the line where chained methods are distinct (below 'replacen' is used to emulate distinct methods)
Please note that the sequence of replaces was due to the code being a first translation effort from VBA.
Please also note the multireplace was not used because the targets were overlapping and multireplace in nim cannot cope with overlapping targets. (e.g. nineight). This code has subsequently refactored such that the replaces were encapsulates ina seq and iterated over.
The seq statement was
I had the following code
after applying nph it became the mess below.
To my mind this raises a number of issues
and not
should become
not
Please note that the sequence of replaces was due to the code being a first translation effort from VBA. Please also note the multireplace was not used because the targets were overlapping and multireplace in nim cannot cope with overlapping targets. (e.g. nineight). This code has subsequently refactored such that the replaces were encapsulates ina seq and iterated over. The seq statement was
which was nicely formatted to