How to add a character literal to a string without ~ operator?

Salih Dincer salihdb at hotmail.com
Thu Apr 4 19:04:18 UTC 2024


On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
> I'm looking for more readable standard function to add a 
> **character** literal to a **string**.
>
> The `~` operator is clearly not great while reading a source 
> code.
> I'm not here to discuss that. I'm looking for a function inside 
> standard library.
>
> The function should be straightforward, up to two words.
>
> Here is what I expect from a programming language:
>
> Pseudo example:

```d
import std.array, std.stdio;
void main()
{
   auto word = appender("hello");
   word.put('f');
   word.put(" ");
   word.put("World");
   word.writeln;
}	
```
SDB at 79




More information about the Digitalmars-d-learn mailing list