fixedstring: a @safe, @nogc string type

Salih Dincer salihdb at hotmail.com
Tue Jan 11 03:20:22 UTC 2022


On Monday, 10 January 2022 at 12:55:28 UTC, Moth wrote:
>
> have fun =]
>
> https://github.com/Moth-Tolias/fixedstring
>
I try Fixedstring and, to my great relief I got the results I 
expected. Thank you, good luck with your work.

So how to fix this double character issue:
```d
FixedString!6 sugar = "şeker"; // in Turkish
   assert(sugar[0..3] == "şe");

   FixedString!5 şeker = "sugar"; // in English
   assert(şeker[0..2] == "su");

   assert(sugar.length > şeker.length);
```

How about adding that member among FixedString?

```d
public size_t usefulCapacity()const pure @nogc @safe
   {
     return size - _length;
   }
```


More information about the Digitalmars-d-announce mailing list