Re: Is there s.th. like enforceSuffix for arrays (string)?

2017-06-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jun 22, 2017 at 06:18:22PM +, Andre Pany via Digitalmars-d-learn wrote: > Hi, > > i often need to check whether an array(string) ends with a specific > text and if not I need to add this text. > > For example I have a variable url and / has to be added to the end in > case it is

Is there s.th. like enforceSuffix for arrays (string)?

2017-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, i often need to check whether an array(string) ends with a specific text and if not I need to add this text. For example I have a variable url and / has to be added to the end in case it is missing. I want to write: ...new RegistryPackageSupplier(URL(url.enforceSuffix("/"))... Of