digitalmars.D.learn - replacement for squeeze and removechars.
- Antonio Corbi (9/9) Jul 18 2017 Hi all,
- Seb (3/12) Jul 18 2017 RTFM:
- Meta (19/28) Jul 18 2017 As Seb somewhat undiplomatically put, there are replacements
- Antonio Corbi (9/40) Jul 18 2017 Thanks Meta and Seb!
- Seb (3/5) Jul 18 2017 Sorry - it wasn't intended to be an offense or aggressive. I
- Antonio Corbi (3/8) Jul 18 2017 Dont' worry Seb, I really appreciate very much your help.
- Jonathan M Davis via Digitalmars-d-learn (9/14) Jul 18 2017 It is, but you have to be careful with it. It could be "Read the Friendl...
Hi all, I'm trying dmd-2.075.0-rc1 in one of my projects where I use `squeeze` and `removechars`. Both of them are flagged as obsolete and in the docs we are suggested to use functions from std.regex and/or std.algorithm. Does any one kow a one-liner from std.regex or std.algorithm that can take the role of those deprecated functions? Thank's A. Corbi
Jul 18 2017
On Tuesday, 18 July 2017 at 15:28:06 UTC, Antonio Corbi wrote:Hi all, I'm trying dmd-2.075.0-rc1 in one of my projects where I use `squeeze` and `removechars`. Both of them are flagged as obsolete and in the docs we are suggested to use functions from std.regex and/or std.algorithm. Does any one kow a one-liner from std.regex or std.algorithm that can take the role of those deprecated functions? Thank's A. CorbiRTFM: https://dlang.org/changelog/2.075.0.html#pattern-deprecate
Jul 18 2017
On Tuesday, 18 July 2017 at 15:28:06 UTC, Antonio Corbi wrote:Hi all, I'm trying dmd-2.075.0-rc1 in one of my projects where I use `squeeze` and `removechars`. Both of them are flagged as obsolete and in the docs we are suggested to use functions from std.regex and/or std.algorithm. Does any one kow a one-liner from std.regex or std.algorithm that can take the role of those deprecated functions? Thank's A. CorbiAs Seb somewhat undiplomatically put, there are replacements listed in the changelog. Use std.regex.replaceAll to replace std.string.removechars: import std.string; import std.regex; // old "abc".removechars("a-z"); // new "abc".replaceAll(regex("[a-z]"), ""); Use std.algorithm.iteration.uniq to replace std.string.squeeze: import std.algorithm; import std.string; // old "hello".squeeze; // new "hello".uniq; Though it would be nice to have these alternatives listed right there in the deprecation message.
Jul 18 2017
On Tuesday, 18 July 2017 at 15:41:44 UTC, Meta wrote:On Tuesday, 18 July 2017 at 15:28:06 UTC, Antonio Corbi wrote:Thanks Meta and Seb! Yes, the replacement is there 8), but as the deprecation message told me "to go to the docs", I only had in mind the library manual pages and not the changelog. I agree with you that, at least, they could also be listed next to `squeeze` and `removechars`. Thanks for your help! A. CorbiHi all, I'm trying dmd-2.075.0-rc1 in one of my projects where I use `squeeze` and `removechars`. Both of them are flagged as obsolete and in the docs we are suggested to use functions from std.regex and/or std.algorithm. Does any one kow a one-liner from std.regex or std.algorithm that can take the role of those deprecated functions? Thank's A. CorbiAs Seb somewhat undiplomatically put, there are replacements listed in the changelog. Use std.regex.replaceAll to replace std.string.removechars: import std.string; import std.regex; // old "abc".removechars("a-z"); // new "abc".replaceAll(regex("[a-z]"), ""); Use std.algorithm.iteration.uniq to replace std.string.squeeze: import std.algorithm; import std.string; // old "hello".squeeze; // new "hello".uniq; Though it would be nice to have these alternatives listed right there in the deprecation message.
Jul 18 2017
On Tuesday, 18 July 2017 at 15:41:44 UTC, Meta wrote:As Seb somewhat undiplomatically put, there are replacements listed in the changelog.Sorry - it wasn't intended to be an offense or aggressive. I consider(ed) RTFM as common internet slang.
Jul 18 2017
On Tuesday, 18 July 2017 at 15:55:00 UTC, Seb wrote:On Tuesday, 18 July 2017 at 15:41:44 UTC, Meta wrote:Dont' worry Seb, I really appreciate very much your help. A. CorbiAs Seb somewhat undiplomatically put, there are replacements listed in the changelog.Sorry - it wasn't intended to be an offense or aggressive. I consider(ed) RTFM as common internet slang.
Jul 18 2017
On Tuesday, July 18, 2017 15:55:00 Seb via Digitalmars-d-learn wrote:On Tuesday, 18 July 2017 at 15:41:44 UTC, Meta wrote:It is, but you have to be careful with it. It could be "Read the Friendly of the person writing it, and it's not always clear which the writer means. And it's used so frequently to indicate that someone should have known to read the manual that I expect that a lot of folks are going to take it the wrong way - especially if that's all you say. So, while it _can_ be used in a friendly manner, it's an acronym that I'd avoid. - Jonathan M DavisAs Seb somewhat undiplomatically put, there are replacements listed in the changelog.Sorry - it wasn't intended to be an offense or aggressive. I consider(ed) RTFM as common internet slang.
Jul 18 2017